A friend of mine is skipper on a charter boat in Monterey. About 10 years ago at Ericks Pinnacle he had a diver that puked in his regulator at around 40. He aspirated some chucks which blocked his airway. As described to me, the diver was aware of his situation and had to make the conscious decision to embolize himself.
Fortunately, he surfaced next to be boat and they got oxygen in him. They got him in the shore based chamber in Pacific Grove and saved his life.
This is one of those situations where you must choose the situation that sucks the least. My take is to remove the second stage with a finger poised on the purge. Position yourself face-down, puke, and shove the mouthpiece in with purge depresses. Obviously, if you get a little warning, head to the surface. Screw safety and decompression stops. My priority is avoid drowning, embolism, and the bends in that order.