I would suggest that he is attempting to counter what he sees as an attempt to 'Westernize' the Muslim world, with Iraq as the linchpin.
With his escalating threats against Israel, it appears that he is trying to undermine American efforts due to our history of friendship with the nation of Israel. One might say he is attempting to start WWIII.
He may be successful.
Osama and 9/11 came a decade too early, Hitler blew his wad in Russia and now Ahmadinejad will get his arse kicked when he could of had the bomb uncontested.