At the end of the day the car is your property, It's not a case of buying it back from the insurance company, it's belongs to you. The insurance company will have an arrangement with the salvage company and will expect to recoup as much as they can. I suspect in accepting their offer and then saying you want to buy the car back is where the problem lies, by accepting their offer the small print will say you have surrendered title to the vehicle. In your circumstances you have to pay the insurance company what they ask, or what ever deal you can negotiate to get the car back.
The best way of dealing with the insurance company after a bump is make it clear in the first instance that you will not be surrendering ownership of the car and expect a cash settlement if they do not repair it. you also need to make it clear that if they have the car it is at their expense until the loss adjuster releases it. The insurance company should not in these circumstances record it as a right off either, although this can often be a sticking point as the insurance company will want to cover their backsides legally it is something that can be agreed during the negotiations.
When this happened to me (my son) I insisted the car was recovered to my house and the loss adjuster viewed it there, the company made a sensible financial settlement and I fixed the car myself, not recorded and it cost much less than the payout to repair the car.