Have bells, or other signal devices, which can be linked with mechanisms. Have pre-programmed task lists set to a given signal. When a specific signal goes off, all dwarves within range of the signal switch to the tasking for that signal.
Oooh - and an "if no task, wait _here_" setting. Along with a "forbidden zone" setting.
Caravan comes? Lever pulled, bells ring across the complex, most/all of the hauler dwarves switch to 'haul imports', reset their job lists, and head to the designated 'wait for jobs' zone linked to this particular task-list.
Siege time? Soldiers are sent to their duty stations, militia is mustered, civilians are forbidden to go to the front sections of the fort.
Oh, and can we link stockpiles to specific task-lists? Maybe a dwarf can only use the stone in the stockpiles next to the catapults if he's set to 'siege mode' or 'godmonsterkillitkillitkillit' mode. (Although you'd need to be able to stock a stockpile at any time, I guess.) Or soldiers could be required to give up their copper armor when a certain kind of bell rings, then when another kind of bell rings they can all put armor on again, only you've locked the coppor armoury and the steel armoury is now unlocked.
Elves come? Bell rings, designated dwarves change their tasking to 'priests', put on their robes, and grab their ceremonial knives. Maybe even have a "Blood for the blood god!" chant.
-Albert