Given your description of the symptoms, I think your problem isn't heart-related at all. Pain on breathing in is almost never associated with heart issues (the only exception is pericarditis, an inflammation of the sac surrounding the heart, which can, in fact, cause pain on inspiration at times, but this is almost always an acute problem which wouldn't last for years nor occur on a monthly basis). What I think you may have is costochondritis, which is an inflammation of the connective tissue between your ribs where they attach to the sternum. It could be something else even less serious than that, but it's a very common cause of the sort of symptom you describe. It is not serious at all, and usually responds to non-steroidal anti-inflammatory agents such as Advil or Aleve.
Why, then, would you feel lightheaded with this happening? I have a theory, and of course it is only that, certainly not a medical opinion, and that is that the lightheadedness may be caused by hyperventilation (most people don't realize they are doing it), and that this is either a result of the pain caused by breathing (which would cause you to want to try and breathe more deeply or perhaps do a lot of sighing respiration). In fact, anxious people often engage in this sort of faulty breathing, and that can, in its turn, cause irritation of the costochondral cartilage between the ribs. It can also cause pulling of muscles in the chest wall, which can cause the same sorts of symptoms and respond to the same medications.
I can't be certain this is the cause of your symptoms, but I can at least reassure you that pain on inspiration pretty much rules out a heart problem. I hope that is helpful. Please follow up with us as necessary.
John Kenyon, EMT, CCT
Non-invasive cardiology tech, Emergency and Critical Care technician, Critical Incident Stress Mgmt. specialist