If we knew that a cretaceous extinction event will happen five, fifty, or five hundred years from now, it'll be orders of magnitude easier for civilization to survive on Earth, then it will be for it to survive in space.
If dinosaurs had opposable thumbs, and technology, they would have been better off bunkering down. No matter how uninhabitable some freak civilization-ending event would leave the Earth, it would still be more habitable then anywhere else in the Solar system.
It's also quite possible to do multiple things at once when you have a civilization with many members. So as I said before, a truly intelligent species would not put all its eggs in one basket. They'd work on figuring out how to colonize space at the same time as figuring out how to deflect asteroids and also handle asteroid impacts if they did happen.
The dinosaurs are a good example of a group of species that weren't far-sighted enough to invest in a serious space exploration and settlement program.