Sorry you have been sick! I always take something like carbocisteine when I'm sick to thin my mucous. It helps. Another thing that doctors recommend is to hydrate. That also naturally thins the mucous. If you drink a bit of extra water, that is going to thin it as well. Cough suppressants aren't always a good idea for the reason you state, it makes it so that you aren't coughing out the 'gunk'. So, avoid meds like that but I'd keep taking the mucous med the pharmacist recommended and drink the extra water. And yes, go ahead and see your doctor. It could be pleurisy as your symptoms fit the profile. https://www.mayoclinic.org/diseases-conditions/pleurisy/symptoms-causes/syc-20351863 If you have an infection and that is the underlying cause, they'll treat that. But pleurisy is often treated to reduce inflammation in lungs with Nsaids (like ibuprofen). You should also get extra rest and not smoke if you are a smoker. But typically, nsaids are the drugs used to reduce the inflammation. If you should have 'trapped' mucus as you say, they'll likely give you an antibiotic. So, yes, go to the doctor at this point!
You need a ct or at minimum a chest xray to gauge whats going on.