You could do what I did in a flat map, it's a little bit intensive, but sounds as if it might require most of the digging in sand, which is easy. This doesn't have to be a very large thing by any means.
It's pretty much an "OH S#@!" tactic, but you can create a small section of ceiling in your entryway supported only with a support hooked up to a pressure plate/lever. (I know, this requires stone for the support and mechanisms, but not much. At least for me, I was able to engineer it to seal my entryway when zombie elephants were incoming... as long as collapsing ceiling still leaves some wall tiles, you should be safe.
If you're not completely averse to using stone and aren't facing amphibious or undead threats, you could create a "U-bend" tunnel, z-level wise with your entrance by the brook and going under. With either trap or lever activating a hatch/floodgate to let the brook flood the bottom of the U, and perhaps sealing the doors on either side, for added entrapment of any victims. Though, if you do this, as with any waterwork, be sure you have a drainage mechanism available (Perhaps even a pit under a hatch or cistern behind a floodgate) to get rid of the water after it gets rid of your unwanted guests.
Stoneless strategies, if you're in a bind, could be as simple as cutting a channel in your entry tunnel before a bend in case of emergency, effectively sealing you in, but keeping any nonflying enemy at bay. At later leisure you could set grates/bars/bridge with control mechanisms over the channel(s), letting you have access outside again. If you do that, be sure to have farm plots inside. From personal experience, you do NOT want to be for all intents and purposes sieged behind such a defensive measure without a working farm program already up and running. (I was asking for it, frigging haunted jungle, built right by the magma tube, what's worse than fire imps? zombie/skeleton fire imps)
Well I've rambled enough, none of these solutions are elegant, but they've all proven via trial by fire. I've got more improvisations I could share, but I'm afraid I'll babble on into the 22nd century.