Yes, unfortunately the AI is hardcoded. I always found the AI of R:TW bit too harsh (most neighbors will attack you eventually). The best TW AI is definately found in Medieval2:TW (if you play Stainless Steel, then you know what I mean).
But I believe some other mods of RTW made use of scripts ....I believe XGM: Diadochi used some kind of script so the AI had to make peace/trade rights with ya if you apply it. Cant remember it all exactly but it was something like that.
EDIT: It's FORCE DIPLOMACY! I just looked it up
