I remember seeing an adventure once a long time ago, I think it may have been a Dungeon (no idea which one, this was pre-3E, pre-Hasbro) which invoved a complex prison. The prison was inside a large mountain (which seems appropriate, since this was set on "Ire Mountain"). Let me see if I can explain it without being too confusing...
The prison itself was designed as a huge disc, with the individual cells inside the disc. The entire thing was sealed, except for a single opening in the roof exactly the size of the cell. The entire prison was designed to rotate slowly, so that every cell in the wheel would be under the opening for a short period. It was designed to make a complete revolution every 24 hours, so that every prisoner would be under the opening once a day. While they were at the opening, prisoners would get their food for the day, empty their chamber pots, etc. This is also when prisoners could get put into an empty cell, or removed when their sentence was up.
If you're more of a visual person (like me), picture an enormous stone pie (refrain from inserting "Orc and Pie" comments please)

, divided into lots of small wedges. The cells are those wedges (or perhaps there were 2-3 cells per slice). The entire pie is covered, so you can't get at it, but someone has cut a hole in the cover exactly the size of one slice. Some device rotates the pie under the cover, so that every slice is exposed at some point.
Actually, thinking about it, I think the original prison didn't have a device turning it. I think the guards just sounded an alarm at regular intervals, and everyone in the prison had to get up and push on the wall to make it move. If everyone didn't push, the wheel would stay put, and you went hungry. Personally, I'd go with some giant dwarven-crafted clockwork mechanism, since the "everybody pushes" method can easily be shut down by a few stubborn and/or insane prisoners.
This setup, though a bit... exotic, offers quite a challenge. Obviously, you'd have to have the "normal" part of the prison too (where the guards and administrators live, kitchens, laundry, etc), but that's an easy dungeon to design. The advantage to this prison is that it places a time-critical element on the rescue (they have to get this dwarf during the window of time when his cell is open, otherwise they wait a day), and it prevents the typical PC tactic of "free everyone in the prison and escape in the confusion". Of course, a facility like this would need substantially fewer guards to control the prisoner population, so combats will probably involve a small number of opponents. You'd have to use methods other than masses of bodies to challenge your PCs - perhaps the prison retains a large number of spellcasters to defend against those teleports you mentioned, or the prison has a lot of hidden passages to allow guards to flank and surround intruders.