If we must choose, we should choose to colonize Mars. Statistically speaking, an asteroid impact is inevitable. Time is the relevant variable. The sooner humanity can be a multi-world species, the sooner we are more robust against that threat. The same will be true of our successors who will necessarily have less time than we to spread from Earth. If we manage to spread to other worlds and Earth is destroyed, we will still be around to develop our successors (and will also have a leg up on spreading to ever more worlds). If we manage to create our successors and the Earth is destroyed before we get to other worlds, it's game over.
The relative habitability of Earth and Mars may actually have a converse effect on the survival of a technological civilization. On Mars, such a civilization would be necessary for continued individual survival for what may be geological time scales. On a recovering Earth, humans may salvage civilization, devolve into a new and indefinite dark ages, or give up on civilization entirely and the species will still go on.
In my personal opinion, if humanity has any purpose or meaning at all, it's to spread Earth life. For all the faux human exceptionalism people like to extol, the one thing we can do that no other life form can do at any scale, is spread Earth life. (Panspermia seems incredibly unlikely to me and probably requires a near-perfect match between initial conditions on the planet and the organism(s) that happen to find themselves there.)
Or would you like to ask somebody else to work on things you do care about?
But yes, Mars would be a mega project. Isaac Arthur does great stuff on Youtube which gives an idea of the magnitude of the works necessary.
I think it would be more realistic to say, if we are able to live on Mars instead of making Mars livable. Being able to live on Mars won't require "the sum total of human activity to date (300k years worth)"
But the flip side is, why not? What else do we have to do...