I came up with this idea, after finding out that I can't cast healing spells
on characters who have had improved invisibility on themselves, though they had broken the primary invisibility (that is, the part which keeps them "unseen" by monsters) by attacking or casting offensive spells, but had the "telltale traces" (as the manual puts it) of themselves visible. I next tried casting magic missiles on the same characters (having improved invisibility broken but not dispelled completely), but it didn't affect them. The text box where the dialogues and combat rolls show told: "Spell cancelled. Cannot target invisible or sanctuaried creatures." Well, this seems to indicate that while having improved invisibility active, no one can directly target me with spells (though I can still get affected by AoE spells).
What this means is that one can use improved invisibility, and provided it is not "dispelled"
by divination magics like true sight, or by dispel magic or remove magic, it can probably protect against all "single target" offensive spells. This might mean a lot. If Kangaxx doesn't use remove magic
on you, improved invisibility can save you against the dreaded imprisonment spell. Or from a Finger of Death or Power word: Kill by some pesky high-level mage. The only thing to be kept in mind is that one needs to ensure that improved invisibility is active, by which I mean that it must not have been dispelled by True Sight or Remove (/Dispel) Magic (though you may still attack and cast offensive spells freely). I have not yet tried this tactic against Kangaxx, but since it does not allow the mage to be targeted by healing spells or magic missile, it logically follows that it will not allow the mage to be targeted by imprisonment and similar "single-target" spells. And if this works, which I think it would, Improved Invisibility must be a seriously overpowering spell, even though it's only a 4th level spell. Just like Protection from magical weapons makes one invulnerable in melee ( albeit for a short time). Better still if you cast Spell immunity: Divination ( to protect against True Sight only).
I am definitely going to give this spell to my sorcerer. However, I would wish someone confirms this tactic, as in my current play-through, I am just out of Irenicus' Dungeon, and it would be some time before I'm powerful enough to face the demilich.
Hail to the school of Illusion!