A piece of good news in all this is that the timescales here are huge. The sun’s bad behavior doesn’t start for an insanely long time, and I’m assuming that if we make it all the way to the end of the green window, our technology by that point will enable us to either A) easily move around to safe parts of the Solar System as needed, B) become a multi-solar species that can spread out to other life-friendly solar systems in the galaxy, and/or C) create safe space habitats that make energy without the need for stars—either through nuclear technology or, much more likely, some advanced technique we can’t conceive of.
So our to-do list is:
1) Get ourselves Earth-proof (by going multi-planetary) before something extincts us on Earth. Which will give us plenty of time to:
2) Get ourselves Solar System-proof before the sun ruins the Solar System.
And when it comes to Item 1, yes, the next mass extinction event could happen anytime, but if we take the next few thousand years to figure out how to expand beyond Earth, odds are we’ll be able to back ourselves up before anything too catastrophic happens.