I've looked into the capx briefly and from what I could make out, the units are firing because they have LOS on the enemy (or vice-versa the friendly) even though that's not the their _current_ target.
I've screen cap'd a modification
What I did was:
-get rid of the Foreach in the Tank1Turret (I was wondering if this was necessary?)
-I picked Enemy1Base by querying the Tank1Turret.Turret,TargetUID.
-Then query if Tank1Turret has LOS on that particular TargetUID.
I test it and seemed to work. capx
(Note that I only modified the friendly turrets, not the enemy.