This very same thing happened to 2 of our boys, usually triggered by crying. They would do the gasping/breathing spasms you describe. It would go on for ours. But every doctor that checked them out said everything looked normal.
They finally outgrew it, so this might give you some peace of mind. Here is my original post where there might be some helpful information for you. My theory is that the trigger for the irregular breathing and involuntary spasms is ALLERGIES.
http://www.medhelp.org/posts/Respiratory-Disorders/Periodic-Breathing-Spasms-in-Young-Infant/show/577913
I'm curious if your son is still having the same problem. My son also has a very similar problem. He makes a sound like he is gasping for air or a really really bad hiccup. I have observed him doing it in all positions. @18 months we had a sleep study done and he was diagnosed with moderate sleep apnea. @2 we had his tonsils and adenoids removed. We saw an immediate imrpovement in his daytime breathing and behavior issues, but he still has the night episodes similar to what you describe above. I recorded him on video and have the video posted if you wuold like to view it to see if it is teh same sound. I showed it to our ENT and he stated it is "irregular breathing" and he doesn't see any form of obstruction happening in the video. He recommended doing another sleep study but unfortuantely I don't see that telling us much since it is so sporadic. He has not referred us to pulmonoligist but I still feel clue less. He is now 2 years 9 months. I woudl really like to know what are the possible causes of his "irregular breathing" and when do we become concerned. In addition, we did put him on allergy meds (claritin) due to him him always having congestion issues and that seemed to help but also did not reduce the nighttime challenges. I had him tested for allergies and those all came back normal, although, the ENT said those are often inaccurate for children his age.