The important thing is that none of us is offering suggestions for marrying the megadungeon setting with modern playstyles like the OP is asking for and just rehashing all our old talking points in a new battleground.
OP: to go a little further than what I said earlier, take an old megadungeon, such as the World's Largest Dungeon and go over it. The map can be the starting point, and since it uses EVERY MM1 monster from 3e, there are pre-existing groups of intelligent humanoids already there for you to flesh out into intra dungeon societies.
The other monsters and features you can go over on a case-by case basis. WLD in particular tries to create ecologies, but for some monsters (outsiders and aberrations in particular) just gives up and has spawner rooms because they HAD to have every monster. You can keep or kill these. Maybe the appearance of spawners is the key to the main plot you're driving; upsetting the ecology and society inside the dungeon.