As far as I know, there is no consideration for what units are attacking the firing unit. This is probably a good idea; otherwise it would be easily gamed by the human against AI units - flood a H/K with fighters and drones to get it to ignore other units, for example.
I was mainly thinking about the Player units' targeting algorithm, and how to minimize the need to micromanage their target selection. Currently, the AI and the Player ships probably use the same algorithm, but I have a feeling that that might not be ideal: The AI's units are usually interested in maximizing damage inflicted; the H/K doesn't really care if the fighters kill it, as long as it does as much damage as it can - the AI will just make more. But because players have more limited resources, their units should place a higher priority on keeping themselves alive.
In the example I encountered, a group of enemy ships spawned behind my lines while I was hacking, and started blowing up my sniper turrets. The snipers could have killed the incoming ships, but instead ignored them until I noticed and manually targeted them. If I hadn't noticed before the snipers lost critical mass, I'd have had to fly ships across the system to rescue them.