When it comes to saving a caravan on a time budget you will have problems getting anything set up in good time. As you mentioned these things like to happen before you are ready.
With a brace of good miners however you can dig a long twisting underground tunnel (1-wide is fine) and stop when you feel its long enough, add a bridge to seal the fort-side of said tunnel. This tunnel should head away from the depot and edge you want traders to leave by. Simultaneously dig an underground highway from depot to map edge, stopping a tile or two short of the edge, likewise add a seal incase of unpleasantness.
Heres the fun bit, cross your fingers and toes.
Breach the twisting path with an upramp, scramble the sacrificialbrave miner back to base as the zombies on the surface should now begin pathing down this corridor, thankfully they are as a rule slow as sin. Once they are moving, breach the highway from the depot to the surface by the map edge with another ramp and the traders will bolt for the edge. The idea here is that while your traders are not safe and are emerging onto a hostile surface, anything of threat should be on the other side of the map heading for the snaking path. Once the depot highway is opened anything not well inside your snaking tunnel may well reverse direction since a better shorter path has been opened, but you probably bought enough time for the traders to hit the map edge.
Oh....hope you didnt forget the bridges, seal yourself up tight the minute the traders pass the lock on their escape tunnel. Half measures or inopportune distraction here will likely result in a fort full of zeds.