If you don't hold it in, the air will simply leave your lungs and you have about 12-15 seconds before the remaining oxygen in your blood leaves your body making you unconscious. The lungs, instead of trading CO2 for O2 is now working in reverse in the vacuum, exchanging O2 for... nothing. That amount of time should be enough for you to reattach your O2 hose and open the airlock etc.
I also recall reading somewhere that you may urinate, defecate and projectile vomit simultaneously after a while, however by that time, you may already be unconscious.
The diving comparison comes up a lot with these space exposure questions. Even the article mentions Scuba diving. But diving is applicable in many ways not just in terms of physiology, but behavior and psychology as well.
I remember there was once also an experiment in an undersea lab where a group of people spent time to see what would happen on similar long duration space missions.
1atm->0atm won't do it, but apparently 9atm->1atm can.
Pressure differentials are powerful.