Ordinarily, you'd plain old drown, because as the screen text will prompt you if you try, you can't build in midair. This is a trick worth remembering. Not always a good idea, because it interferes with the Sniper's ability to dodge and weave back and forth to avoid opposing Sniper hits. Sometimes you just have to have something at the Sniper Respawn if things get ugly. A Sentry on top of the Grate can stop many a Flag Runner, but be careful not to set it up over the respawn point, or your teammates will have something to say about that.
Nobody likes to be telefragged, and that goes double when it's unnecessary.