She's not connected to Gygax, as far as I know. There's a few theories on her origin, but nothing definite. She's just intended to be a setting mystery. As for being a Mary Sue, the thing to remember is that she never had a statblock. It's relatively certain that she kille one god, keeps other gods out of the city and killed a few other various high powered beings, but we don't know how powerful she actually is. There is at least one building in Sigil (Harbinger House) that she can't see or perceive in any way, she gets tricked a few times, sometimes she doesn't seem to notice things, either.
Apart from that, well, she's not intended to be a Mary Sue, in that sense. Mostly because, in most games, she doesn't do anything. In an actual game, she pretty much should never show up and kill something, that's not what she's for. She's there as a background feature, to explain why the setting exists.
Basically, Sigil is extremely valuable real estate. Whoever controls it can go anywhere and by extension, do almost anything. It would win the blood war, if taken, because it makes all concepts of supply line or fortification pointless. However, it can't be a battlefield, with every power on the planes constantly fighting over it, because it was written as a mostly neutral city, where the players can hang out in a cosmopolitan atmosphere, gear up for expeditions to the planes and have political adventures. So the writers had to write in a reason why the archfiends and similar people aren't here. Instead of just writing "And due to some strange feature of the portals, any creature above power level X can't enter Sigil", they chose to instead make that power that keeps the gods out a person, the Lady. Because it's more interesting.
That's what I mean with background features: she's there to answer a specific question. Like "Why is this planet not a frozen wasteland?" - "It's warmed by the sun" or "Why can't I fly off into the sky?" - "Because gravity holds you down", there is "Why isn't Bel here, wrestling Demogorgon in the streets?" - "Because the Lady keeps them out". And just as most players shouldn't take gravity as a personal insult and make it their goal to kill it (though Kudos if you manage to make that a campaign goal and have it work), the Lady should not be prominent enough in a game that the players want to try to kill her.
As for powers having domains in the outlands: she has nothing to do with the Outlands. Her domain is the city of Sigil and that alone, she has never shown any power over anything outside of it.