If:
they are on attack-move
or
just standing around and doing nothing else (mining, building, repairing, moving, hold position, attacking one unit)
then
repair anything that is damaged in their vision.
This is the way it is and the way it has been since product launch.
As many people pointed out - muta harass of a mineral line will kill all of the auto-repair SCVs unless they are instructed to stop mining.
Having a hotkey (0) for a group of auto-repair mining SCVs and doing "0 s" will work to get the SCVs to stop and start repairing nearby turrets, SCVs, extractors and CCs. The problem is that the SCVs are not intelligent and could go to first repair an extractor instead of a turret.
I have personally seen this with a bling / ling bust. A depot was dstroyed and my barracks and bunker were hit, 2 SCVs auto-repaired the yellow barracks as the red bunker started to burn.
I usually hotkey my first groups of SCVs when the action is slow. It helps with repairing, running and marine-SCV all-ins.
