Instead of storing the status ID when closing or reopening a ticket, store its name, that way if the status is eventually deleted, there are no errors.
This is how ticket history is done, so it will be consistent.
Ticket History
Jack closed as Completed 8 years and 11 months ago