Since i rebuilt a totaled m3 i can give some insight on how pricing works when looking at doing it. I bought a 2009 e92 M3 with 15597 miles on it.
1. First thing I did was look at KBB to get an estimate of the cars value with clean title
2. When dealing with a car that is worth about 40,000 you have to cut around 10,000 right off that price for a Reconstructed Title (title you get after fixing and submitting correct paperwork to show it was fixed) so now down to say 30,000. The 10,000 cut might seem high but you have to remember the value of the car. cant just take of 2000, when people hear accident they freak. So you have to take a reasonable number to accurately judge what someone would pay.
3. Have to look at the damage and start a basic parts list of what you know has to be replaced. In my case it was mostly front end damage with some damage to rear quarter panel. So i started a parts list fenders, front bumper, rad support, rad, headlight, rear bumper, inner bumper for front, front subframe, cost of fixing the rear quarter panel, cost of fixing hood, drivers side window, cost of painting) that list is just the basic list then you have to add to that list for the small odds and ends that you will find as you fix the car. So say the parts cost around 8000. So now the car is 23000
4. Next you have to judge the amount of labor that is going to be required to fix the car. Mine i personally put over 100 hours into the car with a few hours from my dad and like 4 from a co-worker to help paint. So Total i would say like 125-150 hours to fix the car from start to finish. So say the garage that is fixing it is charge $65 an hour. so 65 x 150 = 9750. So now the car is down to 13250.
5. Next you have to think for all this work you need to a profit. So say you want to make 5000 profit the car is now down to 8250.
6. So now when you go to buy the car you can pay up to 8250.
This is a rough list of what you have to go through to buying a car like this to fix. You also have to thing of some other issues you cant even see or dont figure out untill you are half way done and at that point you have to just bite the bullet and fix it. Which then hurts your profit. Its a huge risk in this business. The only reason I fixed my M3 was for the father son project and I always wanted an M3 so this was an opportunity to fill two things at once. When looking at buying my M3 i didnt really calculate into the cost of labor since i was doing most of it and it would give me a little more room to pay for the car.
Also for the insurance questions going around. After they do an estimate they will see what the Actual car value is and what the repair cost is, if repair cost is around 75%-80% of actual car value they will total it. But they may also total a car if its only 60% because they might run into the issue that they cant see all the damage or can not give an accurate about of hours to fix something (say fixing a quarter panel or doing some frame pulling) so they give themselves a little margin too play in if the job takes longer or needs more parts. Because once the jobs starts they are in for the long haul if something else arises during the repair process.