Well - the probability is 100% that we'll be hit by one of those asteroids, we just don't know when. When looking at the past data, for these kinds of events, I believe we are "overdue", in the sense that on average we should have had one in the last 150 years I believe.
So working on a solution to this problem makes sense - even if we spend billions solving this issue, it's not lost, because at a point it will be needed.
As for AI becoming an issue, it's a sci-fi idea, nothing more. It's much to vague - how is it reliably becoming dangerous? What are we actually looking for as signs of danger?