You may have more than one problem going on. Some of it sounds a bit like gall bladder, and some if it sounds like a hiatel hernia. I started getting terrible pain in my upper stomach which I also feel in my back when I was 21 years old. I suffered with it for a long time because I was scared to see a doctor....my dad had just died of esophagus cancer! I eventually had so much pain I did see a doctor and they decided it was gall bladder. So I had that removed and the pain came back. So it wasn't gall bladder. I waited a few more years and had an endoscopy and it turned out to be a hiatel hernia.
When you get that pain, try eating some bread or crackers. The pain, if it is a hiatel hernia, could be because you have too much stomach acid backing up into your esophagus. For me, eating some bread or crackers almost always makes the pain go away! It soaks up the acid and relieves the discomfort fairly quickly. I have dealt with a lot of pain issues in my life, but the pain I get with those attacks is about the worst thing that I have ever experienced. Honestly, it is just horrible. Protonix twice a day keeps the attacks to a minimum, but they still happen now and then. It's a good idea, if you take pain meds, even things like aleve, to always eat when you take them. Also, acidic stuff like soda and tomoato products are really good things to avoid if you can! If it happens more at night, just keep some crackers by your bedside so you can releive the pain without having to get up.
Good luck to you, it certainly is no fun to deal with all that!