if the cost of repair is greater than the value of the car, it'll be written off
they can also write it off if the costs are similar.
if the chassis rail is bent you can try and write a letter expressing your concerns about the chassis strength and safety of your own self and passengers in the event of another accident. You can also try making a point about the structural integrity of the car and try to get a write off if that's what your after.