I live and work in NY but I work for an insurance company so I can clear this up a little -
It varies from state to state, but typically if the costs to repair a vehicle meet or exceed a certain percentage of the vehicles ACV (actual cash value) then by state regulation it must be declared a total loss. When a vehicle is totaled, you always have the option to keep it, however, the insurance company will deduct whatever they expect you could get for the salvage value from your final settlement. (This is because if they tool possession of the vehicle, they would be salvaging it and recouping that small amount.) The TL value is not based on KBB either, it is based on the similar vehicles in your local market (mileage, options, condition). Otherwise, they will offer you a settement, take possession of your vehicle and sell it for salvage.
Also, if you went directly to a shop for an estimate without insurance involvement at first, then the estimate is likely overinflated. This is because any shop is going to give you a worst case scenario estimate. The reason insurance company estimates are typically lower is because they write for the damage they can see upon initial inspection...then when the vehicle goes in for repairs, and additional damage is found or labor needed, a supplement estimate will be written and additional payment issued. It's not because they are low balling it. Insurance companies often have negotiated labor rates as well that someone coming off the street wouldn't be given.
It may be your first car, but a few years down the line when you are looking for a new one, you're not going to want to be selling your welding up car with a bad car fax. But if its not totaled, then you really don't have a choice anyway.