You can either draft every civilian dwarf and then manually station them in a room, or you can build out a large above-ground structure that will house yoir primary defenses. The "stay indoors" command only refers to underground places, so your civvies won't go inside that building during war time, granting you a little extra space.
Yes, the stay inside issue is one of the worst problems you face. I wholeheartedly agree with Kagus' advice: Build outside walls so that archers can not shoot into your entrance area and make sure to trap/defend the area from which such attacks could be possible.
In addition, I want to point out a few other issues:
At least in 2D (I haven't had any sieges in 3D yet (^_^;; ), siegers will cheat. That is, they know exactly whether your doors are locked or not and where they are. If you close all the entrances to your fortress, the siegers will simply stop advancing and stay in position indefinitely waiting for you to open the doors again. In a certain way, it is like a real siege, but the issue that they do not even need to see the doors to know that they can't pass is quite annoying. As far as I can tell, that behavior still holds.
Another issue is to forbid all collectibles outside - if you order the dwarves to stay inside, outside items will still create tasks, causing you to get spammed with task cancellations. Especially when the siegers hit your defenses, all the loot will be tasked to be carried to the appropriate stock piles, drawing all hands to the front abandoning useful tasks. Thus, I think it would be best if you made sure to forbid all the equipment of the dead siegers the moment they die and claim it once the siege is finished. Also check the announcements for cancellations of store item in pile/bin because item in forbidden area.
Deathworks
When a siege starts, you can fill this full of restricted zone, and draw in a high traffic zone calculated to take the longest possible time for your dwarves to get outside (mine increases the distance from about 8 to about 50). Once the siege is over, set it all back to normal traffic.
Combined with much mass-forbidding, in my most recent game, I haven't ever actually needed to order all dwarves inside yet...
The battle didn't go too badly despite the dwarfs running around all stupidly. Three useless immigrants got sent to their doom to buy my legendary miner some time to escape, but that's not really a "loss" in my book. And my original miner/mechanic/mason/general build stuff guy got run down by a couple of gobbos but he was awesome managed to beat the tar out of them with his bare hands, and then dug himself in so that the rest of the goblins couldn't get at him.
As for my defenses... well it turned out that I put a pump in backward so that my outer water filled moat bit wasn't quite as sealed as I thought it was. Turned out to be a good thing, though, the goblins promptly rushed down the narrow alley to try to get inside and met with a force of marksdwarfs, which managed to send them running back toward the other half of my marksdwarves which by then had gotten to their posts on the tower by the front gate. So, they didn't manage to do much damage.
Oh, and one of my wrestlers became a legendary champion despite being asleep and off-duty most of the fight, heheh.