a script like this should work
;repair.sqs
_vehic = _this select 0
#loop
~0.5
_dam = getdammage _vehic
?(_dam >= 0.2): goto "repair"
_vehic setfuel 1
goto "loop"
#repair
_vehic setdammage 0
goto "loop"
syntax not guaranteed, but i have a similar script working
:edit:
call it in the init line of the vehic you want to make undestructable:
[this] exec "repair.sqs"