Problem you are telling seems to be because of Eustachian tube dysfunction
and the worsening part is because of locking of tube because of pressure changes. For this you need to take Xylometazoline
nasal drops, Oral decongestants and mucolytics. The chances of tube dysfunction and locking are more if you take flight while you are having URI. Swimmers ear is usually because of water entry into the external auditory canal and needs to be treated with antibiotic, antifungal and steroid
ear drops. Do place a chewing gum in mouth while you go back be flight and put few drops of xylometazoline nasal drops in both nostrils before you board flight.