Diverting the asteroid means, that 1) we can track it accurately 2) the lasers have enough accuracy to hit the asteroid on the same spot, and not cancel each other out 3) the asteroid isn't spinning (but this might allow it to slow down a bit)
Well, if we're shooting at it, it means we can see it. If we see it we can track it.
Accuracy? A laser is a straight line of photons that travel at the speed of light. If we can track it, we can hit it. It's just a matter of calculating trajectories and factoring in gravitiational effects. At the distance it would be at, i'm not sure how lasers could possibly cancel each other out.
A spinning asteroid wouldn't matter much... just calculate its center of mass then fire appropriately to effect the greatest change in desired direction. You might be shooting at empty space part of the time, but the rest will do the work you want.
And only one of those species, extinct or alive has built a civilization.
And if we get wiped out, what difference will all that have made? All the things we've learned and done will be for nothing, save perhaps a step up for the next dominant species.
So in half a billion years, someone needs to do something. Ok. If you going to claim that we should do something now in space, then you need to have a more compelling reason than something that happens long from now.
An asteroid could wipe us out tomorrow.
Evolution never stops. All it could take is one organism able to capitalize quickly and efficiently on the truly huge food supply that is Humanity, and it could all be over for us in a matter of months. That could happen tomorrow, too. Or yesterday, for that matter.
And even if nothing needs to be done for a few hundred years, the fact remains that right now, we *have* the capability. All those hundreds of years from now when things get really grim for whatever remnants of humanity remain after our species-wide catastrophe, it might be impossible to save ourselves.
By acting now, what we're doing is taking out an insurance policy. And in a country where the average person spends about 10% of their income insuring their homes, health and vehicles, it seems odd that we're not willing to go the extra step and insure our Species... But I guess like any other terrifying event, the internal refrain of "It won't happen to me." is hard to contend with.
I've noticed several design suggestions in your code.