Thanks for your question on Health Care Magic.
I can understand your concern.
In my opinion, you are mostly having
musculoskeletal pain because coughing can cause straining of intercostal muscles and if coughing is vigorous, this can cause
chest pain.
Another possibility is lower
respiratory tract infection (LRTI). LRTI can cause
pleurisy (inflammation of pleura). And this can cause chest pain on coughing and sneezing.
So first get done chest x ray to rule out LRTI.
If chest x ray is normal then no need to worry for LRTI.
Musculoskeletal pain is more likely in your case. So avoid movements causing pain. Avoid heavyweight lifting and strenuous exercise. Apply warm water pad on affected areas. Take painkiller and
muscle relaxant drugs. Don't worry, you will be alright. But first get done chest x ray to rule LRTI.
Hope I have solved your query. I will be happy to help you further. Wish you good health. Thanks.