I had a similar problem quite a while ago.
My car was in a crash and was taken away for assessment.
My insurance company came back to me and said the cost to repair the car was more than the value of the car itself and they offered to write the car off.
The problem is, when they assess the repair costs, they always use original parts (which are a lot more expensive) with dealer repair rates, so the costs are always way higher than what you could get done at a local garage.
My friend is a mechanic and runs his own garage and he assessed the car and advised me to buy it back from the insurance company. If I remember correctly they paid me out the agreed value for the car less £200 (value of the car after the accident) plus I got my car back.
My friend repaired it, then it had to have a new MOT and someone came out to inspect it.
At the end of it all, I got my car back with a new radiator, bonnet and wing with 12 months MOT .... and I ended up £50 in pocket by the time I paid for the repairs from the insurance money :)