Speaking of internal logic (and a great way to spend the time), a fantastic way to come up with a megadungeon that has a history, of sorts, is the game How To Host a Dungeon. I usually will stop play when things look "interesting" and record a map, inhabitants, etc. Here is an example of one of my favorites:
To date, no one has found this place. It exists, somewhere, waiting to be explored. . .