In the center of my fortress I've got a complex with farms, food processing and storage, a dining room, and a small barracks, and a well all connected by internal doors (once inside a dwarf can reach any part without needing to go out to the hallway. When a siege comes I recruit all the non-combatants into a squad, and station the squad inside the complex. Once most of the dwarfs are inside (it seems to be impossible to get them all to go anywhere) I lock the doors to the hallway, and then ignore them. They have enough food in there to last far longer than any siege. If it looks like it might run low I can release the farmers from the squad, turn off all of their hauling jobs, and hope they do some farming. There aren't enough beds in the barracks for everyone, but it doesn't really matter if a few dwarfs have to sleep on the floor. It is by no means perfect, but it works fairly well.
I've also tried keeping a lockable "front door" and simply locking the dwarfs in during sieges, but this doesn't work very well. It keeps them in, but generates many job cancellation notices as the dwarfs keep trying to go out and get the gear, but then can't find a path. I think all the path finding errors even slow down the game, making the darn siege seem to last longer.
Drafting them into the military automatically turns off all hauling jobs, so there are less pathfinding errors. There are still some, because they want to go take a break in the statue garden, or look in their chest, or go visit a different well to get a drink, etc. :roll: It's better than having them all try to run out to get the dead guy's bloody shirt though.