A 8 or 10 tile long or so (6-wide) part of my entrance hall which was covered in checkerboard-patterned hatches over a 10-z-level drop directly above the processing department, where each color of the checkerboard was linked to a different output of a repeater, resulting in the two colors of hatches alternately closing and opening. At any given time there would APPEAR to be a path across the hatches for the invading goblins, only to have the hatches open (and the others close) while the goblins were trying to cross, dropping the goblins to their doom.
It was called the Hand of Armok, and it consumed massive amounts of goblins, delivering them infallibly to the processing department, where they shattered into their component parts. The metal items were melted down, the non-metal equipment and clothing were dumped in magma, and the body parts decayed miasmalessly in open air down to bones and skulls, which were then turned into bone bolts and totems by the craftsdwarves.
Not a single goblin dropped by it survived (although some that I manually pitted elsewhere did, interestingly, even though the Hand of Armok dropped a lot more - several hundred, probably, it killed something like 70% of the participants in every siege, before the rest retreated).
How did I keep the dwarves from running across it, you ask? Simple. I had channeled out the entire entrance hall's ceiling all the way back past the Hand of Armok, all the way to the trade depot, so that it was "outdoors", and when the goblins invaded, I set the "dwarves can't go outside" option, and they entrance-danced deep inside next to the trade depot, where they were quite safe inside the fort. Then I flipped the lever which turned on the Hand of Armok's repeater, and the mayhem began. To the goblins, there still appeared to be a path across it at any given time.
The one problem with it was that it used a primitive repeater design, one of the first (might have been the first, I don't remember - I seem to have originated the name, at any rate). It only had one pump, and the two pressure plates did not output signals that were precisely opposite in timing ( http://mkv25.net/dfma/movie-281-repeaterinaction from Jan 3 2008 shows an early repeater of mine, although the Hand of Armok was completed by Dec 24 2007, and had a working - if unreliable - repeater by then).
I use a very similar design, with a few important modifications.
First off, there are retractable bridges underneath the main walkway. Just a 1 Z level drop. This allows me to not kill any goblin until they have all been captured. This way no one ever retreats.
100% lethal trap, disposes of 100% of a siege.
The second modification is that I use water to flush them into the pit of doom. There are actually two pits that I use. The first one is a traditional splatter pit. They fall down and explode into glorious red mist.
The second pit is the evil pit.
Its entirely full of kittens...and also every creature I can get my hands on. I just put them all into that tiny, 2x2 pit. This allows every animal to attack every goblin at all times. Clever use of pumps lets me keep that pit dry while the water pushes the goblins into their kitten doom. All bones and goblinite does remain in that pit of course, but then I can periodically pull a lever to drop half of the contents of that pit to a collection area below.
This lever not only delivers piles of goblinite and goblin bones, but at the same time there are hundreds of exploding kittens!
Goblinite delivered with a side of exploding kittens?
Armok be praised!
Everything was powered by levers, using about a dozen dwarves sealed off from the rest of the outside world, given only food and water. They would do nothing but socialize in their tiny vault, protected by iron block walls 4-5 layers thick in all directions. The vault itself was at the base of my castle, and to any invader it just looked like the base for one of my towers.
As there was absolutely no access to the outside world, my fortress could never fail. The dwarves were also always available to pull levers, which let me be able to very precisely control my traps. I briefly experimented with nobles in this vault, but they were too prone to tantrums, so I just used regular dwarves instead.
The nobles got their own vault. The noble vault had no food or water, and had an untamed dragon in it.