I guess that it could take into account if it is going to attack fully or not, and plan to use suicide units or not accordingly.
That's a good solution but I think it's better to limit the amount of experience gainable from fighting spells and summons, similar to what happens with barbarians. Maybe 20xp from level 1spells, 30xp from 1 and 2 combined, and 50 from level 3 creatures (like wraiths) and 1 and 2 combined. At the moment my defenders are gaining 100+xp from puppets and ghouls. The AI should still attack but not make me stronger by doing so. Also sometimes they may benefit more from keeping their summons in defense rather than suiciding them, that's where your idea could come in very handy.
Other issues and questions:
Bannor are ready to capitulate but they can't negotiate because in crusade, and won't come out, so they're wiped out.
Vassal States producing random civilisations instead of a new leader from the same civilisation.
Is there a reason why we can't trade food between cities like in Civ 2? It's strange to have a city in starvation when hooked up to the trade network.
On a related note, could loss of population through starvation trigger damage to defenders? This could encourage real sieges where attackers intentionally cut off food to weaken the defense.
Is there a reason Illians can't build more than 3 Priests of Winter?
Can we have reduced diplomatic penalties for declaring war in retaliation to a world spell, for example Infernal stealing a city?
Sometimes I want to protect AI A from AI B, but A won't grant me open borders, so I need to declare war on A in order to enter his land and protect him. It's a messed up situation. Can we negotiate a 'passage of war', where I declare war on B in return for A giving me open borders until his own war with B is over?
For the issue with freezing/ holding spells, what about a counter-spell that cancels them out completely or increases the chance of resistance?
Technology trading and culture flips missing from the game.
I can't buy cities from my vassals (they can still buy mine).
I know the AI doesn't have a 'memory' for enemies outside of view, but for fixed dangers like Acheron it should! Again and again they bring stacks to attack me, pass them through Acheron's range, and are destroyed within 2 turns of entering because they don't even turn back. They should recognise and remember the danger from the first encounter and never return to it (unless they're truly ready).