Hmm. You could create two hallways, like you had, and have both have raising bridges that are over grates with pressurized water underneath. It goes into one, hopefully the short, restricted one so there are no dwarves, and you raise the bridges and drown it. Pumping in magma would work too, but would obviously be more difficult (unless you don't have a river on your map, in which case you would need to use a pump anyway).
Alternately, if you are feeling cheap, just do the same two-hallway setup, and have both have a wide ceiling supported only by a single support. I believe that building destroyers will automatically destroy supports, but if you want to be sure then put in a pressure plate or hook it up to a lever.
EDIT: Just reread and noticed the fully automated part. I guess the second option wouldn't work then. If you wanted to make the first automated, hook up two pressure plates and make the bridges create only a 1-tile wide hallway that you'll pump the magma in to ensure that the FB is always moving on top of the pressure plates and keeping them active. I'm trying to remember if pressure plates turn on or off gear assemblies though. If you didn't care if it was strictly automated, that could just be hooked up to a lever and the beast could be caged until you came back and killed it.