I have chest pain on right side which my gp said is from muscles. Can this cause pain while breathing and also shortness of breath?

Yes. Every time you take a breath, you stretch the muscles holding the ribs and that causes pain. The pain will make you feel you have to stop breathing and that gives you the sense of sob.
Possibilities.... The chest wall has muscles, cartilage and bone and any of these structures can be injured leading to pain. And this pain can increase with breathing, resulting in shortness of breath. Coughing before pain onset is a common scenario. However, if the shortness of breath is getting worse, you need to see a doctor asap since there are many serious disorders that can lead to difficulty breathing.