I've talked before about thinking critically about how your monsters actually live in a dungeon setting--how they interact with their neighbors, the tasks they do on a day-to-day basis, and so on. Sure, undead and constructs can simply stand immobile for decades on end, but living creatures should have a bit more verisimilitude in how they utilize their home. One good way to think about this is to do the same thing you should be doing for yourselves--have an evacuation plan!

This process works even if you only have a rough sketch of your dungeon map. You don't need the final, finished version; in fact, things you learn during this process likely improve your final, finished version quite a bit. Make a copy or two you can mark up.

First, mark who lives where. You should annotate your map with things like "2 ogres," "6 goblins," and things like that. You should have a good visual representation about where creatures generally live on your map. This is also a good place to confirm that all the creatures you have living in a room can effectively fit in there (and, preferably, fight in there).

Second, mark obstacles. Mark any doors that are consistently locked, as well as traps that can't be bypassed easily even by someone who knows where they are. Note anything that takes some time to get through, like an airlock or a portcullis that's time-consuming to raise or lower. Things like chasms, pits, barred doors, and other impediments should also be marked down in this step.

Third, evacuate! Pick a chamber with creatures in it, and draw the path from their room to the exit of the dungeon with a line. Imagine there's a fire, flood, swarm of bees, or something that forces the creatures to leave as quickly as possible. Is their path blocked by a locked door that they can't unlock? A trap they can't quickly bypass? A room full of poison gas? Perhaps most importantly, does their path take them through other creatures that they don't like, and would normally fight? If any of these are true, your creatures should be very concerned about not having an effective evacuation plan. You should draw a new path for each area with creatures in it, even if those paths go through the same areas. Remember that some creatures have ways to get around obstacles that other creatures don't. A spider can climb across a chasm that an orc can't, but the orc can open doors.

Now you have the evacuation plan for your dungeon! Okay, maybe you've done the above and determined that a bad fire is going to pretty much kill everyone in your dungeon. This is a problem, and not only because certain groups of PC absolutely will start a fire to clear out the dungeon. Here are some ways you can fix it.

Fix-It #1: Overcome, bypass, or remove obstacles. If you've got something in your creatures' way that prevents an evacuation, either place a way for the creatures to overcome it (like putting a coil of rope at the top of a high cliff), bypass it (like giving creatures keys to locked doors), or remove it entirely (for example, don't put a portcullis where you had it). This makes evacuation easier for the monsters. But note it doesn't have to make things easier for the PCs! Just because the goblin on the other side of the locked door has a key doesn't make it any easier for the PCs to get through the door. And seeing a 20-foot-long wooden plank on the other side of a 15-foot-wide chasm doesn't make it any easier to cross the chasm yourself.

Fix-It #2: Provide alternate pathways. You might consider adding additional doors or halls to the dungeon to let the creatures move around a little more freely. As a side benefit, this lets the PCs move around a little more freely, too. Players like when they feel they can sneak around an enemy or attack from an unexpected direction, and having multiple pathways allows for some meaningful (and fun) decisionmaking.

Fix-It #3: Add new entrances/exits. A lot of dungeons have only a single exit or entrance, and that's often a problem for reasons other than evacuation plans. It allows a powerful monster or clever group of PCs to bottleneck everything too easily. Nearly any dungeon is improved by adding another exit or two, or windows, or a chute to safety, or something along those lines. These don't have to be obvious; the secret tunnel is a tried-and-true solution that's hidden too well for casual observation to discover. After all, you don't usually want the PCs stumbling right into the climactic encounter with the villain first thing. 

With all this talk about "fixing it," though, keep in mind that sometimes you don't want your creatures to get out easily. Sometimes the villain puts her minions where they'll feel trapped or cornered to convince them to fight against all odds; other times your creatures are really not very smart (goblins, anyone?), and pinning themselves in behind a spear launching trap is something they might very well do. But when your creatures can't evacuate the area, you should know that they can't and have a reason for why they're in that situation. 

Finally, if you haven't thought of your own emergency evacuation plan for yourself, you should probably do that.