I'll just add that in all creatures (including us & our snakes) stress seems to diminish the immune system...so it's possible your snake has (or had?)
a very slight RI and his body needs to fight it off...which means minimal handling, and don't worry about him eating right now...just let him rest, &
if he's still on an antibiotic, be sure you do the full course, otherwise [stopping the antibiotic] can promote resistant germs in your snake.
If a snake drinks water & then we handle them, a certain amount of water &/or bubbling might appear in their mouth, just because our handling is
putting pressure on their internal organs forcing a little water back up in their throat. Better to observe him closely without holding him.
As already noted, a snake on medication is not going to be happy with us, nor are they likely to want to eat, so just relax & give him time. New
environments do the same thing for snakes...cause stress & food refusal. And honestly, if I was him & accidentally drank from the water bowl with the
poop, I'd have been gagging too...
It's very stressful to force a snake's mouth open...don't do it unless absolutely necessary, & then, don't keep doing it if you ever expect your snake to
eat again. He's probably not flicking his tongue much because he is not hungry...again, from the meds and the handling. He's not happy with you
right now, so just be patient...let him rest & get back to normal. Finish the meds as directed by your vet, and wait a week or so before offering food,
unless you can clearly see that he seems hungry before then.
With any luck, all is well, so relax...