The sums are fairly simple; if the cost of repair (total costs including hire cars etc etc) minus your insurance excess is more than the cost of whatever they pay out to you minus what they get for the car as salvage, then they'll write it off.
So (I'm making up the numbers for the example..):
£10k repair + £400 related costs such as ins co. admin and hire car, minus say £300 excess = cost to ins, co. £10,100.
Insurance payout £20k, minus £8.5k salvage payout, minus say £300 excess = cost to ins. co. £11,200.
On the above basis, they'd write it off as it's £1,100 cheaper than repairing. It's a bit more complicated than this in reality, as they'll also factor in VAT, but if you plug in your own figures/estimates, you can probably get a fairly decent idea of what you might be able to negotiate.
Logically, if you said to them: ok, don't write the car off, but give me an £8k payout, they would be quids in, as would you. Not entirely sure, but your insurance company may be willing to do this without writing it off. You can work out the numbers and try to come to a deal that's easy for them, and saves them some hassle.
If they definitely intend to write it off either way, then if I were you I'd conclude negotiation on the payout before entering into discussions on buying the write-off. Damage doesn't look that bad, unless it's shunted the front and needs jigging.