Here's my thoughts:
If the Friendly fighters are winning the fight against the enemy fighters. Do not AA.
If the friendly Fighters are winning the fight against the bombers, and it looks like
will all be shot down before they get to drop, do not AA.
If there are friendly fighters and they have not all shot down the bombers before
get close, or it looks like they will survive to drop, fire away kill them all.
If you are a good shot with AA, you can shoot down enemy planes with friendlies in
the air, while avoiding shooting down the friendlies. It just takes timing and aim, and
not spaming your shots.
As a CV driver there is nothing more annoying than having more of my fighters shot
down by friendly fire than the enemy.