I tend to use something like Tarot cards for things like this. One to three cards for a location, major npcs or sometimes even player characters. One just to give a general feel of what might happen. Different decks normally have slightly different pictures. Sometimes looking at the card will give me inspiration, sometime the reading of a card. The suit of the Minor_Arcana can have many readings for example if you get Queen of Cups, may be a local Bishop comes to town; followed by 4 of Coins, he buys a local farm and Seven of Swords, but now he regrets his action (I wonder why?).
If I were you I'd go for one of these options:
a) The Megadungeon is a city.
Either someone decided that building underground was a sensible move due to unfavourable conditions on the surface (ice age? magic fallout? a desert world like in Dune?), or your party is a group of outsiders among a race of underground dwellers (Dwarfs, basically - have you considered having an all-dwarfs party?)
Assuming you want to create a Dungeon/City - personally I would take an existing city from a module, reduce it a bit in size (digging is harder than building "up", so this would restrict expansion) and try to re-plan the various areas, main monuments and building etc to make these fit a vertical layout... so for example the poorest neighborhoods/slums would be be in lower tunnels, while residential/business would be closer to the surface (or maybe vice-versa, if you are in a Dwarf settlement). Consider also the potential to have an underground port.
A fun challenge could be taking the maps of an existing dungeon and modify the description of the various areas thinking of how a human (or other civilized humanoid) would change the various corridors/alcoves/pits/rooms to make it work as living and business space. (This is probably too complicated to work, because one thing Dungeons seem to consistently lack is sewers and running water).
Alternately, the Megadungeon is still a city, but it's not a classic underground dungeon. See for example "Big Rubble" in Glorantha, which is the ruins of a former great city. Or see this question: Dungeons that aren't dungeons.
b) the Megadungeon co-exists with the city
Personally I think this less "plausible", but to each his own. You have a large city (imperial capital, for instance) which is built on layers of older versions of the same city. Or the city has an impressive sewer system. Or both.
On the surface, the City Guards rule. Under the surface: Thieves Guild, Assassins Guild, Unspeakable cults, Necromancers, Troglodytes, Things Man Was Not Meant to Know...
The City Guards prefer to use deputized adventurers when it's time to take the ... "investigations" below street level.
c) There's a symbiotic relationship between a surface city and underground city
This is a variation of theme (b) above. You have to come up for a reason for a sort of mutual gain. For example, the underground dwellers have lots of valuable things to exchange with the people above. It could just be "metal vs. food" or something more sinister like the Morlocks or the Classic Star Trek episode "The Cloud Minders".
Finally, I'd suggest you to have a look at this other question: Are there any non-D&D mega dungeons? The answers give pointers to products for non-D&D games, and they can provide a fresh look at the "problem", and possibly something that may be more amenable to a story based campaign.
Best Answer
The only system I've seen which directly addresses this question is ACKS, which is a B/X neoclone, so it should fall under the "osr" tag. This is covered in the SRD in Chapter 7: Campaigns under the heading "Populating a Dungeon", or on page 141 of the published core rulebook. (While the specific context of that section is determining what monsters move in to a dungeon constructed by a magic-using PC, the author has confirmed on the ACKS forum that it also applies to "wild" dungeons.)
In summary, the method is:
Determine whether the dungeon is located in a Civilized, Borderlands, or Wilderness region. In ACKS, anywhere within 50 miles of a city or large town is considered Civilized, the next 25 miles out is Borderlands, and anything beyond 75 miles from the nearest city or large town is Wilderness.
Periodically make wilderness random encounter checks for the dungeon itself. These checks should be made once per month in Civilized areas, weekly in Borderlands, and daily in Wilderness.
If a wandering monster is encountered (i.e., visits the dungeon), roll against the monster's % in Lair chance. An "in lair" result indicates that it takes up residence in the dungeon.
When 1/3 of the rooms in the dungeon are occupied, the dungeon is "full" and any further new arrivals will displace existing occupants (killing, evicting, or enslaving them) and take their place.