NASA started 'the space race' right after Sputnik and it ended in 1972, so you should include 1959, 1971, and 1972. That puts the total at 45.26 Billion over 13 years.
The numbers I quoted are adjusted to 2005 dollars, which correlates to the figure of 45 Billion that I saw there as well. Why even talk about 1960's costs when they are irrelevant to what it would cost today.
Preserve the human race how, though? If this were 1350 and you had a boat would you shove your family onto it and push it out to sea to save them from the plague without any destination in mind and insufficient resources? That seems rather ill-advised, cruel even.
I did the calculations to show that your optimistic 30 years is BS. Look, 30 Kilotons and even a super-rocket capable of payloads of 100 tons (the shuttle's maximum payload is about 32 tons and it is designed for massive payload lifts) would take how many launchs? 300! How many shuttle launches have there been since 1981? 114 in 25 years at a cost of 145 Billion dollars with two 'catastrophic' failures. 2% loss (which isn't horrible).
Factor that into the 300 launches to build, say, a mega ship in space and supply it and you have to have at least 310 launches in 30 years. But it would take about 10 years to develop and test this so-called super-rocket to lift 100 tons at a time. So, you're down to 20 years to manufacture and launch 310 rockets. You're insane. That's a rocket launch every 23 days (if the numbers haven't sunk in yet).
I'm somewhat pessimistic about generalized human space exploration, but the pessimism on the scenario, which you proposed in the first place, is wholly justified. You ask for a nearly impossible task and then say that my realistic (based on real data) assessment is pessimistic. You betcha!
It could be done, yes. It would take global cooperation never seen on the planet Earth ever before in all of recorded history. Somehow I still don't think the impending obliteration of Earth would be incentive enough. You obviously haven't followed history and current events.
ETA: If you are going to argue "Why not use the 30 ton launchers we have now?", the calculations there are even more disappointing. That would require 1000 launches of 30 years, which figures as one launch every TEN days. That is inconceivable to be possible for the next hundred years even in anyone's wildest imagination.