You don't want NPC wizards to be too powerful and clever. For simplicity's sake, I'd almost recommend just being wizard 20, and just add in some PrC abilities you feel you want your caster to have.
Equipment is important. Give your character either a crafter cohort or CWI and buy gear at half price, since NPC wealth is what it is.
+5 Tome, +6 item, the usual. Animated shield or +5 mithral buckler.
Figure out what constant/daily protections she has, what she can put up in a hurry, and how she'll attack if needed.
Put these in first, and then figure what classes the character needs to get all the stuff you want her to have. You'll probably want to nova any encounter with PCs so consider qualifying for multispell and autoquicken.
I've built very few epic casters, and they're not super-optimized - optimizing too much will break the CR system even more, in any case, and isn't really superior to just giving the challenge more levels, to account for the increased difficulty instead. here's what I still have from a 26th level wizard:
[spoiler]
Feats:
5 Epic, 4 Wizard Bonus, 7 generic
Improved Spell Capacity X3
Multispell
Improved Heighten Spell
Improved Initiative
Quick Draw
Dark Speech
Silent Spell
Still Spell
Quicken Spell
Empower Spell
Heighten Spell (used on everything with metamagic)
Items:
Headband of Intellect +6: 36K
Permanently Invisible:
Ioun Stone, (absorb 50 spell levels)
Lavender and Green ellipsoid (40K)
Ioun Stone, ( regeneration ) Pearly White spindle (20K)
Ioun Stone, Dusty Rose Prism: +1 insight AC (5000GP)
Ioun Stone, Orange prism: +1 CL (30K)
Robes of the Evil Archmagi: 75K
+5 armor ac, +4 saves, +2 cl checks vs. SR.
Stone of Good Luck: 20K
+1 luck bonus on saves, skill checks
Handy Haversack: 2K
Amulet of Natural Armor +5: 50K
Cube of Force, 62K
Ring of Freedom, 40 000
Ring of Demonic Wizardry IV: 60K (Only CE, req. spellcraft 20)
Gloves of Dex +6: 36K
Belt of Bodily Health(Con) +6: 36K
Cloak of Etherealness:+55K
Glamered +5 mithral buckler of heavy fortification:
100K+2.7k(no crits, SA)
Spells memorized:
1st: Nerveskitter x4,
2nd: Create Magic Tattoo(CL+1), Alter Self, Mirror Image
3rd: Sound Lance x 3,Displacement, Fly, Haste
4th: Spell Enhancer x3, Assay SR x4, Force Missiles x2, Empowered False Life(+20HP), dimension door
5th: still Assay SR, Quickened True Strike x2, silent Dim.Door
Wall of Force x2, Magic Jar, waves of fatigue
6th: Anticipate Teleportation, Greater x1 (140ft.)
Heroism, Greater(+20HP),
FleshShiver, Stone Skin, Solid Fog x2
7th: Quickened Steeldance , Energy Immunity, Arcane Sight, Delayed Blast Fireball, 2x Plane Shift
8th, Horrid Wilting, Moment of Prescience,
Superior Invisibility, Mind Blank,
Silent Still Dispel Magic, Flensing
9th: Astral Projection, Maw of Chaos, Prismatic Sphere,
Quickened Teleport X2, Silent Still Ethereal Jaunt
10th: Empowered Flensing, Quickened Chain Lightning
11th: Quickened Delayed Blast Fireball, Silent Still Freedom
12th: Quickened Empowered Disintegrate Quickened Ghostform
[/spoiler]
The other epic NPC caster I built was a 27th level MotAO Dread Necromancer - MotAO is great for NPCs as you can pull any spell you need out of spellpool, so...
Anyway, she used more MiC items.
She also had a RKV Cohort who used shield other on her.
Some notes:
[spoiler]
Feats:
Feats 2x Multispell, Corpsecrafter(+4 str, +2HP/HD undead), Rapid Metamagic, Empower, Quicken, Cooperative, SF:Necromancy, Undead Leadership, Eschew Materials, Ignore Material Components, Destruction Retribution(undead explode 1d6/1d6per2HD 10ft burst, Ref 15 half)
Equipment:
Belt of Battle, Bracers of Arcane Freedom, +5 tome, +5 manual (read), Haversack, Luckstone, Ioun Stone, Orange Prism, +5 Anchoring Leather Armor of easy travel, improved agility, masking and fire resistance, greater, Belt of Battle, Bracers of Arcane Freedom, +5 Ring of Protection, Amulet of nat. armor +5, Broom of flying roughly 70K GP
[/spoiler]