When they set off to you, they probably don't know. When they're close enough to see you having raised the "I'm sorry, we're experiencing some technical issues, please walk away and try again later" banner, they're probably within sight of your foe's reguard scouts (off-map abstracted one, at least). I think they're going to walk into trouble (or, as with those examples, walk in with trouble).
I could see departures being curtailed/reversed. Assume they would be safer going back to where they were departing from as soon as they spot the incoming danger - possibly they see it before you get on-map signs and re-arrive to herald the problem. And you get to choose whether to keep/re-open their entry or make/keep closed those turtle-shell drawbridges and perhaps force them to plea/flee at that point.
A little more intelligence (or pretend-intelligence) might not go amiss. Don't show up two tiles away from the nasty thing(s) that you've managed to keep from moving too far away from one particular edge-point. Tactically delay their arrival (but still exist) while they resolve their situation by circling around the off-map edge to somewhere more suitable, chance of being overcome anyway, without showing up at all, chance of over overcoming the same threat, perhaps drawing on-edge forces away ("Some of the Vile Force Of Darkness depart, looking distracted", but then who next reappears?), a chance they'll remove themselves from the incoming queue as they move onto the jext trade stop, back to report to the Mountainhome or just randomly go and look for a slivghtly less infested-with-undead-siegers Library site...
Plenty of things to do, but you shouldn't expect a procession of immigrants/whoever just be hardcoded to not even consider arriving. Could use a version of the Off-Site Raiding code, except set up with no input from the Overseer, maybe?