What causes involuntary gasping or snorting?

If asleep, then. apnea is probable. If awake, then it could be tracheal hiccuping which is a mediastinal twitch/ spasm noted with certain neuromuscular problems. Or some esophageal spasms noted with hiccuping. I would see a pulmonologist if they are gasps and not hiccup, and your oximetry suffers.