your profile doesnt say where you are located, which makes advice hard to give- different states, different rules etc.
might be idea to use this service from RTA
https://ols2.rta.nsw.gov.au/VehicleHistoryCheck/
Personally I wouldnt touch a car that has been written off and then repaired, but IF you are still keen doing the relevent checks on the VIN and engine numbers to ensure you are still able to actually register it would be a good idea.
Again, depending on which state you are in, you are certain rights as a consumer when buying a car from a dealer. Make sure if you do intend to purchase, you dont sign those rights away in the event you have trouble registering. But I wouldnt touch it... no way, even if 'good value'. If it was so good, why isnt the dealer arranging repairs and then onselling.