I found a minor bug in the attack control code relating to the situation where only behemoths attacked but that's not the source of your problem (I included the fix in your code as well). I wasn't able to reproduce a runtime error but you have a problem with "nonbehemoth_wait_for_behemoth_hexes" and "behemoth_wait_for_nonbehemoth_hexes". Those are the hexes where nonbehemoth hexes wait for behemoths to get into position, and the hexes a nonbehemoth vehicle must get to before behemoths proceed, respectively. These hexes
must be contained in "attack_hexes".
In module "Basenames" the names of all bases are whenever a building is started, completed or captured (actually I think "started" is redundant but never mind). So your base name changes would get overwritten. Just moved your naming to that module.
Hm I received a guy from another nation after having scored 10 kills.
And now some other stuff:
Your bases are quite tight so the crane can't reach all buildings in the base. Consider specifying "crane_not_allowed_to_repair_area" in the enigneer control code. Else you will keep getting "destination unreachable" errors which also causes these pseudo-laggs we discussed before.
In the same neighbourhood you should also constrain the cargo bay crate gathering areas to areas the cargo bay can actually reach (again to prevent "destination unreachable"). Actually I noticed not even engineers can reach some crates spawned in the very lower left corner of the American base.
All right, the Americans use two factories. I know the code indicates this is possible but it's not a fully supported feature and factory extension rebuilds Iøm almost sure doesn't support it. But somehow it seems to work out relatively fine anyway. What do you know

But at least consider only having the rebuildable factory extensions specified for one factory.
"base_in_area_map" is initialized nicely. But now it's never used.
About the attack hexes in the attack control code: Some hexes are a little too far apart. There should be at maximum 15 hexes distance between each attack hex to avoid the pseudo-lagging. And this includes letting the attack path end just outside the originating base since the vehicles are simply told to move to the human pullback hex when they reach the last attack hex.