Unfortunately, the AI in MTW is something that is not incredibly easy to modify, in fact, I don't think you can modify it at all, you can manipulate it to some extent by limiting the units it builds to ensure it doesn't build cheap, poor quality ones. But that's about it. If you want an everlasting alliance, try allying with someone on the other side of the map (e.g. Castile-Leonise with Kievian-Rus). That way, if your ally survives long enough, you and your ally will crush the enemy in between you without much threat of your ally backstabbing you. Your paths won't ever cross until only you and they are left standing. Then you're merely left with one extremely massive, immensely strong, unbelievably rich faction that you have to contend with.