You could somehow write a piece of script to see if the ship is still visible, if not then it stops moving. You would have to use the vec_for_screen functions and it would be long and complex but...
For some reason, my ambition always seems to beat my ability.