I dunno, does the wizard know those level 20s are coming?
Assuming he's done any sort of scrying, a million strong army will most likely be known to the wizard. Therefore, it's most likely that he's got time to prepare. Also, they've got to be low on magical items.
Therefore he can Genesis a flowing time plane before they arrive, giving him nigh-unlimited amounts of time to prepare. He could gate in things to kill for experience, but we'll assume it's capped at 20.
Now what he can do is cast Explosive runes, and prepare the Haunt Shift trick. So now he has a hardness of over 100, and the entire area is blanketed with explosive runes. Since 1 year = 1 day, that should be easily several thousand casts of explosive runes. He will cast this on 400 books (10-20 casts per).
Then he took 10 levels of Incantrix (he did Prestige class, right?). If not, he prepares wands and other magical artifacts until he rewinds himself back to level 10, and uses prepared Gate scrolls and wands of Gate to summon Balors and other high XP monsters, which he then easily kills with the magical artifacts to wander back up to 20.
The purpose of Incantrix was for one lone trick. He teleports into the middle of the group of level 20s. Now, some of them will win on initiative. But there's very little you can do in one round to a Haunt Shifted Wizard. Objects are immune to SODs, and with hardness that high very little will do damage. He's almost certain to get a single round.
That single round consists of quickened persistent Time Stop.
Now with 24 hours of time stop, he goes around handing people their book of explosive runes. He then casts dispel magic as many times as needed (using wands if need be) until every book is dispelled.
Finally he genesis flowing time plane rests until he gets all his spells back.
Now when the time stop fades, some of the level 20s may survive, thanks mostly to Uncanny dodge. But they'll be rogues/barbarians, and thus unable to hurt a Haunt Shifted Wizard. With all of his spells, he can pick them off whenever he wants to.