If I get serious about defending I add landmines. Deadly serious. Traps are outstanding, just make a huge pile of giant axe blades, serrated and spikes then just put out a hundred traps in little clusters, two or three deep like this: (x=trap/mine)
x-x-x-x
-x-x-x-
x-x-x-x
This especially works if you know which way the goblins/invading humans or elves come from. In my case after two sieges I know which way they will approach from every time and just lay out a nice field of mines. If you want to do more add bait for them to chase after on the far side of the mines. Goblins or whoever enter the map and go racing after the bait and have to walk the mine field first. Once I completely surrounded one of my forts with mines just for fun and it was very, very, bloody, gory fun. Watching a cyclops drag itself along with one arm and slowly bleed out after stepping on several mines is entertaining.
The point of defenses is to not just put up a wall and moat, but to add LAYERS of defenses. Along with mines if I ever get around to it I add bunkers around the map at key points of interest. Basically invaders walk in, find mine fields, walls then these little sealed up pillboxes that suddenly open up like a vickers machinegun then disappear just as fast.
Never had any caravans die on the traps either, game lists the area around them (3x3) as non-accessible so caravans go around.
If you want a safe fort, add layers of defense, the more hell the invaders have to go through in order to attack the fortress proper the safer you are. Do not limit the surface as your only line, dig a hallway as your are first building your fort and use it as a trap corridor as well with arrow slits in the walls. If someone wants in the fort... Make them pay for it, one bloody inch at a time.