A shop that's very experienced in frame work can fix that. Simple straightening won't do it though... the metal has already been stressed too much (yielding) and will never be as strong.
With careful work the shop could lift the rear of the body off, cut off the damaged parts, source a frame in a salvage yard that doesn't have rear damage, and cut and graft in the new rails. Reinforcement by laminating plates on both sides is a good idea since all that welding will weaken the immediate area around the beads from the heat.
But, you can get a good frame in a salvage yard for under $1500. The problem is unless you do the work yourself the labor costs will be enormous to change everything over. Expect 2 days from most average shops to do this amount of work.
I know you have an emotional tie with the truck, but, honestly, if the insurance is giving you a good deal of money for the truck, take it and go find another one.