Dee,
Thanks for your question.
Though I think there is little likelihood that your upper right back pain is related to heart disease, or your pacemaker/defibrillator, any unusual discomfort, especially with your history, should be evaluated by a physician. This most likely is caused by a musculo-skeletal source such as arthritis, pulled or bruised muscle or ligament. There are several other possibilities, such as referred pain (pain felt in one area that is caused by a problem in another area) from the abdomen, such as gallbladder disease, irritation of the diaphragm (breathing muscle), or other process in the abdomen or chest.
The only way to answer this question is to see your doctor for his evaluation. Most likely, this is minor, but the visit is necessary to be sure nothing major is going on.
Feel better.
Martin Cane, M.D.