One thing I'm curious on, what determines if a player is "active"? Are specs the only inactive or is it if the player spawns? If it is non spawning and spec, that probably should be tweaked. It should be spectator only. If you are on the team, you should effect balance decision even if you don't spawn for whatever reason. Yes this sucks but it would screw the act of balancing otherwise, and players need to be more considerate of their impact to the team by not spawning. Go spec.
I haven't even attempted to mod Mount and Blade and the code looks a bit strange but from what I see:
Round 2 is banner balance. Then it tweaks the teams after this.
aka round 2 it heavily fucks up team balance, and then it makes minor tweaks to try to re-balance it.
If I understood what I read (and I certainly may have not), this is not how you "balance" things. Your first effort to balance is quite possible the most un-balancing act of them all. While I absolutely agree clans should play together, there needs to be a greater degree of balancing in round 2 then simply by banner.