I've seen my vet do this too. I asked him about it once and he said it's to make sure he's got the tube in the stomach instead of the windpipe. He blows into it first, then smells for stomach gas when the air comes back out. If he smells it, he's in the right place. Gross, but effective I guess.
I can't figure out why he put the tube in to begin with though. He wasn't planning to worm at first. I didn't see him add any meds. Maybe he was looking for an obstruction?