AI Strategy - Follow the Leader

I was just racing a follow-the-leader race. We were down to the last 3 karts. I was last and there was only about 5 seconds left. The kart in first place picked up a gift, and then promptly turned around and fired a bowling ball at the kart in second. This gave me just enough time to pass into second, winning the race. It was very interesting to watch, but I wonder if there is an easy way to add checks to the AI for situations like these.