From: Hansville, WA, USA
roll some dice, replace the ship with a brand new one
This could probably be accomplished through LUA scripting. Periodically check (every x minutes) for the ship's damage level. When it exceeds some point, delete the damaged ship and replace it with a new one and assign it to the same mission if any. Any specialized loadouts/cargo would have to be reestablished also.
“There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.”
Charles Edward Montague, English novelist and essayist
~Disenchantment, ch. 15 (1922)