Ah, the doom bridge. Not an original or clever name, but so far the most effective and trouble-free siege defense I've ever built.
Before reaching my main fortress (a green glass above-ground megaproject) visitors must pass over series of ten 3X10 copper bridges end-to-end. The space under the bridges is not tiled out, as you might expect, but is smoothly tiled over with marble. The ground on either side of the bridges is channeled out, three tiles wide by ten deep.
This trap takes advantage of the fact that retracting bridges throw creatures up to 3 squares when they retract or extend. When a siege arrives, a dwarf pulls the lever activating a water-powered fast repeater. All ten copper bridges automatically retract and extend every 100 steps. Because the bridges are placed flat on solid ground, a clear path always exists between the intruders and my fortress, avoiding the whole problem with invaders stopping in confusion to re-pathfind. They never stop running into the trap entrance, but the bridge path is long enough that they can never make it far before being flung off the bridge to fall to their doom.
Recently I added on two side corridors, each one tile wide, running along the outer sides of the drop pits. These have pressure plates triggering 1X10 tile retracting bridges, and set up to lure wandering animals, thieves, babysnatchers and ambushes to their doom automatically throughout the year. It's always amusing to see a pressure plate trip and bridge retract for no apparent reason, followed by the sudden appearance of previously-invisible goblin corpses at the bottom of the pits.
It's not as amusing or dwarfy as the corridor of flame trap I built once with pumps, lava, and grates, and would probably be looked down on by purists as being too easy of a way of killing hundreds of orcs a year. But with a megaproject to build I can't afford to dedicate half my population to military, and the orcs give me the unlimited metal supply I'll need.