Can't you just leave the city? I mean passing the gate until "leave area" appears. The problem itself remains though...
But I actually wanted to note that again I have this spamming my screen. The game goes on but one message of this kind after another...
http://img820.imageshack.us/i/recalculateais.jpg
And again it happens after a faction has been destroyed not directly after but let it be a day later and after a declaration of war. No clue if this is refers to the problem but in this case Portugal was at war with the Marinid Dynasty which was eliminated by Kingdom of Aragorn. A day after the "Faction eliminated"-message Aragorn declared war on Hasfid Dynasty and the script started spamming.
Spamming in a way that playing is no fun
... that is, of course, with debug messages on.
EDIT: Right after my post I updated and saw that scripts have been edited. I was curious and started my old game and it changed it. But still messages are coming up all the time.
http://img13.imageshack.us/i/recalculateais.jpg/
May be it's because of the crap that happened before and in a new game this wouldn't happen....well, I don't know but you do.