These NPCs are usually quite unique, in abilities and what they perform. Much more so than fighting creatures, usually, as there are so many spells - or at least, quite a few and quite a variety of effects.
There is the option of beefing them out with attacking spells, but defensive spells are also good. Think - if you are casting 4 fireballs, to not kill yourself, some sort of elemental protection might be good.
If thier intelligence is high enough, they will also check saves, some immunities, spell resistances (not of items, only the spell "Spell Resistance" and the monk feat). Saves are the main point - so now, they won't cast "Fear" against a dragon. Race is checked, and so on and so forth.
Best targets are also attained (not linked with intelligence yet). A simple loop makes them pick targets that won't hurt them, and less of thier allies.
But there are some things you may wish to know before making them:
Some things that can annoy PC's is variety. As soon as the PC works out what spells creature X has, and what Y casts, it gets easy (this is for PW's). I got scared as hell when I started fighting custom monsters, and was badly prepared. Having 3+ varients of an "army standard" caster - IE not boss, or unique or powerful (as they would be rare anyway), makes it a lot harder. It also caters for having a large variety of spells that one must be able to do something agaisnt the PC.
The only thing I recommend is letting the NPC caster always having ultravision. Darkness annoyed me that NPC's were hopeless - this is totally changed, but ultravision still helps greatly.
Variety is the key! That and a higher than normal prereqresit ability score for toughness. Also, fighters can quite easily disrupt a caster with low concentration, aim for slightly higher, or more so, as one knockdown on a 40HP level 10 caster may mean death almost instantly.
Also, check out advanced buffing, and spell triggers, the advanced buffing is the bioware default (checks range on heartbeat, and instant-casts several of its spells, IE, what the PC's do - an advanced buff). Spell triggers are like that of BG, they get the effects of 1-5 spells cast instantly, based on level, and make for a good start to them, or a tougher lich. These don't care about what they have, so they cheat a lot!
And finally, the buffing allies can be used for some casters/mages who want to help thier allies more. There are spawn options for this, very useful. The other thing is "Long range spells first" and makes sure that Vampiric Touch (even if a good spell!) is not used before Magic Missile, unless, of course, they are in range of Vampiric touch to start with.