I'm currently working with a weapon-trap linked hatch combination referred to as a "grinder".
Basic Set-up:
Hp TTT pH
H (Floor hatch over open space)
p (Pressure pad linked to Hatch) - minimum weight creature trigger, and resets
T (weapon trap)
Creature passes over the hatch, hits traps, then hits pad that opens the far hatch and can't pass. Traces back through the traps and hits the pad on the exit side and that hatch opens and they cannot leave. Meanwhile, first hatch closes again and they trace back. etc. etc.
Some goblins and such will get clear eventually - they meet some cage traps and my military.
I have sets of these in parallel on both sides of my access tunnel. When the goblins attack the access tunnel drawbridge goes up and they route through these*. And of the 3-4 of these in the tunnel one is generally always "open" as a trace path into the fortress. So the attacker doesn't quit and look for another way.
*- My set-up is modified also by having a spike trap outside the first set that is linked to a lever. When the trolls stop to destroy/displace the hatch they get spiked/speared to dissuade them. I also often have fortifications for the marksdwarves nearby to facilitate the process. One thing I hate is a set of sieging goblins "camping out" in the tunnels doing nothing.
Caveat: I did not invent this particular trap combination. Goes to someone here on the forum.
Good things about this set-up:
1. Made from simple components (pressure pads, weapon traps, floor hatches)
2. Your dwarves don't trigger the pads, so they can walk right over it if they want
3. Not a lot of digging, just the spaces under the hatch locations (and I connect them up back into the middle of the trap) and the depth is just that additional Z-level. And non-fatal if one of your dwarves falls one level (as compared to the risk of a deep pit or dodge-me trap.)
Cons:
1. Can take a while for your mechanics to build since there are pads, linkages, and stocking all the weapons in all the weapon traps.
2. You need the weapons to stock. Excess goblin weapons work, but you also probably want some nice trap component weapons as well. These might take a period of time to accumulate.
3. The traps can clog with goblin bits. At that point the efficiency drops. (but this holds for weapon traps in general)