Bot collect drones when enemy appear in local, but you need to define timeout enough to collect drone. In two cases bot may loose drones:
1) when PC appeared in overview. Bot will warp out as soon as possible
2) if enemy appeared in local but NPCs with scrambling property are close to the ship. Bot will try to warp out and drones left in space to kill NPCs in case you was scrambled. I have never tested if this method really saved at least one ship, but probably loosed drones a lot.
But to continue attack NPC while enemy in local is also not very good solution.