A few things to clear up about AI behavior
Firstly, they can't fly. AI have no ability to grab the helm in any scenario, even if your captain has left the match. (A bit of encouragement, the pilots who d/c on purpose in the middle of the match rarely make it out of novice. If you stick with the game a little, you will rarely have this issue). If you want your ship to stay in the fight, you'll need to have one of the remaining crew members fly the boat until, hopefully, your pilot comes back, you get a new one, or the match ends.
As far as repair cycles go, yeah they can be a bit wonky, especially on certain ships. One of the reasons AI don't really get improved on is the AI are more of a fail safe. The game is designed to be played with humans, so developer attention goes to things that benefit human players before improving the AI. The robots have also been improved drastically over the years. They're better now than they ever were, even though they still make a lot of mistakes.
In case you didn't know, the commander on the ship (the player highest on the roster, goes to captain unless captain has left) can control the AI. By hitting F2, the AI will shoot the guns and stop repairing, while hitting F3, the AI will drop any gun they're using and start fixing things, looping around the ship, prioritizing certain components in a cycle. F1 sets them to their default nature (AI engis repair, AI gunners shoot)