Thank you for using JustAnswer. I will be glad to assist you today.
The most likely cause of this was some acid reflux that tried to enter the airways of the lungs
and caused coughing. Coughing is one of the body's natural method for protecting the airways. If any liquid or solid tries to goes down the airway, it will cause severe coughing until the substance is cleared from the airway. In this case, with the burning sensation in the esophagus, that is strongly indicative of acid reflux, and the coughing is suggestive that it tried to go into the airway.
In this situation, since you felt fine after 5-10 minutes, and are having no ongoing lung symptoms, such as persistent cough or shortness of breath, there is no need to be seen emergently and it is OK to go back to sleep. If you have any medicine to relieve stomach acid, such as antacids, Zantac, or Prilosec, then it would be OK to take a dose of what you have. But even if you do not have one of these medicines, a single occurrence of acid reflux causing coughing for 5-10 minutes is not worrisome to the point of concern about going back to sleep. It certainly is true that acid reflux is a condition that should be treated, and you can get any of the above medicines over the counter, but you do not need to make a special trip to the store at this hour to acquire one of these medicines.
If you have any further questions, please let me know.