Thought i might chime in on this as i had my E39 written off last month.
Different circumstances though, the rear end was hit at 70, exterior damage - the bumper was destroyed, spare tyre well was crushed, back end of the car had been pushed forward - the back doors wouldn't open. It wasn't until i got under it and pulled up the boot carpet etc i discovered the chassis was split in three places The battery had been crushed too (although still worked!) i think the diff was damaged too.
I would have a damn good look around everything. Mine was still driveable apart from the odd sqeek it went alright.