There's a book called Mythic by Tom Pigeon that might help you.
It has some interesting ideas about how to approach your dilemma, but it will depend very much upon what type of adventure/scenario and/or campaign you wish to play.
While I've never played a DMPC as discussed here, I have been playing since the original game and the precursor games and have often found that playing what I call an "Attached NPC" or ANPC works very well for me and is a great deal of fun.
Basically an attached NPC is an NPC who is directly attached to the party and/or their on-going adventure campaign for some reason. Like the old idea of a man-at-arms in earlier additions but instead of serving one of the characters as a page, servant, or combat comrade, the ANPC is a real character who is not part of the official party membership or group or team, but is involved in similar missions/quests as the party and so naturally develops an alliance with and often works in concert with them, and often adventures or explores with them. In military terms you might think of such a character as a type of Liaison Officer, or a Warrant Officer, attached to a team for special functions. You work in the same unit, attached to the same or similar ends, but your rank and chain of command remains separate from the norm in direct team interactions. In law enforcement you might think of it as an agent for another agency or jurisdiction attached to your team to work a common case as part of a Special Task Force. You work together directly and towards a common end, but you remain in effect separate agents with your own jurisdictions and backgrounds. In medieval times you might think of Knights Hospitallers working alongside Knights Templars at some common action. I've even in the past developed small teams of three or four characters of ANPCs who operate as their own party/special missions team directly working alongside the player-character party, and these types of situations work out extremely well and are immensely fun for me to play as well.
You can play the ANPC in any number of different ways, as a Deus Ex Machina device if really neeed (though this should very, very rarely be necessary, and should never be used as an easy "escapist" plot device), as an occasional support or leveraging persona who adventures with the party only on occasion when their mutual objectives overlap, or as direct support personnel (the liaison office mentioned above), someone who adventures often with the party but maintains his own agenda and ultimate purpose (for example Boromir in the Fellowship of the Ring, he was an official member of the Fellowship but his agenda was always his own, and he never really intended the real purpose of the Fellowship, he was using the Fellowship to his own end, even if just subconsciously.)
And that is the real fun of the ANPC, the ANPC can act in the party's favor, can assist them, or also be following the same or an overlapping agenda, or can even be corrupting and undermining the objectives of the party by subtle and covert means while appearing to be working in their favor.
An ANPC can also be serving a third party as a spy or infiltrator. An ANPC can also begin as an agent or ally or even a real friend of the party and later develop into something else, or can begin as a spy or agent working against the party and through the normal course of game development and human interaction morph into a true friend or ally.
The game itself, your personality, and the "fun paradigm" (do you find it more fun to play against the interest of the party, in favor of their interests, or some combination in between) of playing that character will determine how you play the ANPC. The important thing is that the ANPC shows up often enough to be a real and viable support character and not just a mere single adventure NPC or temporary gaming device. In other words the ANPC is a consistent and on-going game factor, an important one, which you as DM play, and who interacts directly and often with the real party, but always remains an outsider to some greater or lesser degree.
But as Doug hinted you do not wish the ANPC to become a Mary Sue. (Or an anti-Sue for that matter.) The ANPC should share the same dangers as the party while interacting with them, their own while not, must be open to being killed or badly injured, can be discovered out if acting as a spy or infiltrator (and that's part of the fun in such cases, can you keep the players from divining your real motives or purpose, even if that is a good one?)
An ANPC is of course to a certain extent a self-insertion into the overall party as a character, but it should also be an entirely separate character in it's own right.
That is to say it should be developed as any ordinary character, but with the guarded realization that because you as DM are playing that character it can never really be a full party member, it must always to some degree be on the outside looking in, and it should be used cautiously no matter how it is employed.
It is a sort of compromise, a sort of amalgam between a real character and a NPC, but if you keep it separated from the real party then I've found it is very possible to play such a character as a DM and really enjoy the experience without directly endangering the real party as being both character and DM. But if properly played and employed the ANPC can be a very fascinating and rich source of material for both in-game character dynamics and for out of game player development.