It comes down to insurance and salvage titles mostly. In PA, the vehicle I have experience with was valued by insurance at $11.5k, minus a $500 deductible, so $11k. That value determination was made by the insurance company by market factors, which is why market value comes into play. Looking around at comparable used vehicles of same make, model, year, mileage, I found that to be fair price.
The cost to repair from multiple shops within transportable distance (important consideration as I'm sure someone somewhere could have done it for less) was $16k. To get it to an ugly but functional state was about $10k, which would have to be paid out of pocket.
Even if repaired to "roadworthy" condition, it would need to be reinspected and if deemed to be roadworthy would hold a salvage title, meaning insurance would go through the roof, my liability coverage would be dropped, and the car could not be resold. If not deemed roadworthy, more cost.
Needless to say, I considered the car totaled and used the $11k for a down payment towards another Honda.
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.