In my opinion backstabbing should always be possible, when relations to the ally are not good and my faction and/or the backstabbing factoin is not trustworthy. In addition to that, the backstabbing faction should not destroy itself with its action, that means they should only attack me, if the odds of beating me are fair. That was imo one of the main problems in vanilla with backstabbing: my own faction being much stronger is attacked by weak allied neighbours. In reality, no one would do this with an allied faction, because through such an action, the aggressor can nothing but lose.
I think in your mod this works pretty fine.