EVERY ins company has different formulas on totaling a car.
usually MOST insurance co will total a older car when damages exceed 80% of value according to their car value books.
usually the newer the car the lower percentages will total it.
a lot of insurance co will write their own estimate and use salvage parts instead of new like the body shop probably has on their estimate. this price difference car save sometimes save a car from being totaled.

my first step i would suggest searching for comparable values on the totaled car. different ins co used different ways on determining value. SOME ins company's still try to use WHOLESALE values on a persons car. .if you have actual local confirmed values on comparable cars chances are better on getting that value.

on buying the car back. again every insurance co does this differently. usually the ins co will have a estimate of what the car will bring at a salvage auction. you can usually buy the car back at that value .the best way to keep the car is when discussing things with your adjuster. would ask them what you can buy the car back for. this is the first step.
years ago their was a set % of the payout what you can buy the car for. some, not many, co still do this.

word of warning. if they have the lizard ins co be prepared to get screwed without a significant fight.
i recently repaired a 2017 VW TDI sport wagon with 70K miles on it insured by them.. they wanted to total the car that had $1,500 because it had extremely good salvage value..in the end totaling the car would have cost them almost nothing because salvage values were so good on the car and their payout was so low.


perception is 90% of reality