What this Hadith tells us is that if someone says "If I do such and such thing, I will be a Kafir", now, if he really meant that if he did that he will adopt Kufr, then he will at once become a Kafir. But if he meant that he will strictly adhere to Islam and never take the way of Kufr, he will not become a Kafir but the style in which he said it was certainly wrong. Therefore, he must make repentance and beg forgiveness from Allah for it. It will be better if he recites again Kalimahtush-Shahadah to renew his Faith.