Allow Astromechs and FC's to be made with a storage compartment to place parts kits. Add in Droid commands based on the kits, /repairengine or /repairshield, for example.
For the purposes of balance, it also need to be both less effective than doing repairs at a station or by hand. My answer to this problem is twofold.
- All repairs done in flight by a Droid cost two repair points from a kit per point repaired(a 1000 point engine repair kit could only do a total of 500 points by a droid).
- A Droid can only repair half the existing damage(a 450 hp engine down to 250 hp will only go up to 350 hp, the next time this abilityis used, it will only go up to 400hp, and so on).
Edit: I forgot to mention another part of the tradeoff. I don't know anything about Droid Engineering, but, to avoid the potential of having all the most potential Droid commands and the repair ability, using astrogation parts and storage compartments should be a trade-off. The more storage the Droid has, the fewer commands should be possible, and vice-versa. It should be a trade-off. "Do I want to have weapon repair kits, or Shield Shunt 4?"
I keep thinking about scenes in the movies like in ANH when Luke tells R2-D2 to lock down that stabilizer or during the escape from Naboo when the squad of astromechs go out and work on repairing the Queen's ship.
It could crank up tension in some battles if a component gets particularly damaged and we gotta restore systems to a functional state.
I just thought that it would be nice and in line with the movies if droids, and by extension, Flight Computers, could initiate partial repairs without hitting a station or resorting to space commands. I know careful balancing would be required.