I hear you there. Here are some things to keep in mind when dealing with this.
+Poor Diet and lack of exercise
+Prolonged anxiety/panic
+Smoking
+Alcohol consumption
+Eating before bedtime
+Eating acidic foods
These things all put you at risk of developing acid reflux, maybe not one on it's own but a few working in tandem against you is where it's at mostly. Some people are slaves to antacids for long periods because of it. Allowing this to continue for years can erode your esophagus which lead to spasms, holes, cancer even but I do believe there is medication for it. I would guess that it always starts with what you put into your stomach in the first place but there are other factors like stress obviously. The problem easily spills over into bedtime because of the parts at work here.
If you have acid reflux quite a bit, drink alcohol and have sleep apnea, then you are at pretty good risk of having bronco spasm episodes in your sleep. It is an involuntary response. For me what would happen is that I would be sleeping and holding my breath because of the apnea, the acid would pass by my larynx and alarm me. I would wake up in a panic and inhale deeply causing the fluid to force its way into my lungs practically. With the lungs full of garbage at that point I wouldn't be able to breathe in or out very well, very labored. Then you take turns coughing out the stomach contents and trying to breathe. Depending on the severity of the episode, it could last a couple of minutes and might cause you to vomit, further making it a terrifying ordeal as you struggle for air and try to clear out your lungs.
My girlfriend witnessed it a couple times and I bet it really scared the crap out of her. I lost some weight and don't snore or hold my breath quite as often or as severe. Probably the biggest help is to not eat before bed, I wouldn't drink alcohol before bed either. Only asking for trouble.