I don't know what the Insurance Department Regulations are in your state, but it may not be a bad idea to find out. You can probably find out by doing a google search for the department of Insurance for your state. That may not be a bad starting point.
You should also look at your own policy, under the Physical Damage and Collision portions to see if they'll pick up any excess.
As for your specific question I'll provide some generic information. In general, when insurance companies look at damaged metal they perform an appraisal to determine what the cost would be to repair the car. If the cost meets or exceeds 75% of the car's ACV (Actual Cost Value), they will total it. Insurance companies don't want to be married to a car. The last thing they want to do is to repair a borderline car and then have the owner continuosly calling complaining about "this isn't right or this is still wrong or not working properly".
Now, if they decide to total the car, the problem is the ACV. Most companies (based on what State Regs tell them to do) figure the ACV of a car by different means. Some will use valuation services that provide market analyses of the current value. Or they may use valuation guides such as Kellys Blue Book or NADA books. In some states they are required to use an average from different sources.
The biggest problem it seems that you may be facing is that even if they total the car, you may not get enough to cover to cover what you paid for the car. You may have to eat the difference.
Regarding Dimished Value I've attached a link to a site that may be helpful.
www.ican2000.com/dvfaqs.html
Good Luck,
Tony