I finally figured out how to use the battle win functionality, and to check for who is in the others territory. Which means I can make factions lose if they are going to conquer new territory, but still perform normally at home. I so I redid the entire script from the bottom up, and replaced the attrition and movement features with battle lose functionality, that takes effect before a faction becomes too big.
I found that comparing faction strength does not work to intention. Think of the following scenario: faction A has 3 regions, and we do not want it to expand beyond that, so we tell it that it cant attack smaller factions. So it cant attack it's neighbor faction B, which has 2 regions. But now faction B conquers a region from another two-region faction, which it may fight against because it is of equal size. Now faction A can attack faction B, because they are of equal size, so faction A has 4 regions, above its limit. If we were to continue this, they can "swing" to any size. Which is why this approach doesnt work. The AI will always expand as much as I allow them, and that very fast. The only thing we can do is tell each faction how big it can be in absolute terms.