another option although difficult to code might be a repair option for the ship the ship becomes immobile and defensless much like when it is upgrading and restores a certain % of its health per turn based on its current percent of health
This isn't particularly difficult to code. At worst, it's a bunch of if statements, or if you're smart about it you could do something like
[repair rate this turn] = 0.05*max(1, floor(10 * [current HP] / [max HP]))
[HP restored this turn] = min([max HP] - [current HP], ceiling([max HP] * [repair rate this turn]))
and you can toss a min(x,y) in there if you wanted to cap the repair rate below some level. I don't know that we could do this in the XML files, but it's certainly something that someone who had access to the game code could implement fairly easily.
I personally would prefer something more like
[HP restored this turn] = min( [max HP] - [current HP], max(1, ceiling([repair rate] * ([max HP] - [current HP]))))
[HP restored this turn] = min([max HP] - [current HP],
min( [max HP] - [current HP], ceiling(F([current HP], [max HP])*max(1, ceiling([repair rate] * ([max HP] - [current HP]))))))
where F([current HP], [max HP]) is a scaling factor such as [current HP] / [max HP] or (0.5 + 0.5 * ([current HP] / [max HP)^2) which slows the repair rate when the ship is badly damaged.
This gets the ships back in action relatively quickly but makes it take a bit longer to restore a ship to peak condition, whereas your model leaves ships out of action for a relatively long time but finishes quickly. Probably a matter of preference, but I tend to feel that a repair model that makes it so that your ship is in usable condition relatively quickly but takes longer to complete all repairs is more interesting than a repair model that makes it take a long time for your ship to be restored to usable condition but quickly completes final repairs. The former incentives risking damaged ships, the latter incentivizes restoring them to perfect condition before sending them out again.