But OP states that, body aside, the car's condition was suitable to deliver at least two more decades of driving time. Buying a different used Civic at market value would introduce an unknown, unbound cost of repairs to reach that goal. Unless you're a mechanic it's essentially gambling. Or* it's a new vehicle-- in which case it will cost vastly more than the cost of the body repairs.
I suppose I understand why the market is relevant-- if it were $1 then it would be worth the gamble. But given OP's goals and foreknowledge of the car's condition, I don't understand why market value would create a hard limit against paying for the repairs. That foreknowledge is worth at least a few hundred dollars, probably way more if you factor in time to find another car and risk of it being in ill-repair. Edit: (Not to mention the depth of knowledge since OP had been driving it for nearly a decade already!)
Edit: Plus the fact that OP would have run this car into the ground. So while market value still plays some role, resale value does not.