be sure to let the ins company know you want only genuine BMW parts and want the repair work done only by a BMW service center. That will likely make it so expensive that they total it (if they agree)...otherwise...the repair may come out better than it was before. I would only be concerned if there were frame damage in which case for sure they will total it. Only other thing to consider is that if there is frame damage or if the air bags deployed, that will be reported and show up on a car fax report which may seriously reduce the resale value.
Good luck and let us know what happens.
_______2006 BMW E90 330xi_______