Those frames can be repaired/straightened fairly easily if they aren't too bad. Unless the frame is folded down or bent very bad it can be straightened and be safe! To total a vehicle damage has to exceed 70% of the value, sometimes more.
If the vehicle is repaired properly there will be no diminished value. If it wasn`t repaired correctly or not at all then there will be diminished value. Carfax is used incorrectly by most people. Just because Carfax shows an accident they think its worth nothing or next to nothing.
Have it repaired and it will be just fine as long as it isn't beyond reapir.