Choking/gagging from inhaling water is something that, oddly (to me, anyway), I don't recall being discussed in the PADI OW certification material. That has been on my mind since my OW training when I did exactly that. Thankfully we were only down about 10fsw or so, and after trying to regain control of normal breathing for a bit, I finally said screw it and surfaced.
As luck would have it, I was at the bookstore the other day looking for Diver Down, as someone on here had recommended it, when I came across the Scuba Diving Third Edition book. Randomly thumbing through the pages I found this gem on page 128:
If, in spite all you do to avoid it, you inhale some water and start coughing, try swallowing hard three times in rapid succession. The swallowing helps you overcome your coughing reflex.
Since there's no simple way to test that, I'm hoping that is sound advice, because that's exactly what I plan on trying next time it happens. :doh2: I think I'll give the forums search feature a spin and see what I can find about the recommended ways to deal with choking on water while underwater or start a new thread on it if I can't find anything conclusive.