I think the auto guns should act like the auto guns on bombers.
That is to say, if someone is manning a 5" gun, then the auto guns fire at the target he is firing at.
I have done a lot of 5" gunning and its frustrating to see the auto guns targeting the fighters as I try with futility to bring down the formation with my lone 5" gun.
There should be a deferential that checks whether a friendly is in the 5" gun in your logic path ahead of the targeting code. If-then check to see if the scope of the gun can intersect with the manned gun, if-then bring the auto gun to bear on the manned gun target, and lock the auto gun on that target unless or until the target is destroyed, out of scope, or a second manned 5" gun has a greater scope intersection with the auto gun at which point auto gun deference would shift to the other manned gun.
Any 5" gunner that has auto guns working with him would get the kill too...

That is my two cents.
1Way