Actually, I suspect that you misunderstand their objective. Oh, maybe stopping a US invasion is a secondary objective, but I don't think that's their primary objective. Their primary objective seems to be (if you take their word for it) bringing about a new Caliphate under Shi'a dominance. To that end, nuclear weapons would be a huge advantage.
Iran wants to meddle deeply in the affairs of its neighbors, maybe assassinate those who don't play along, support those who strike at Israel (HAMAS and Hizb'allah, for instance) and the like. This furthers their objective of establishing a renewed Caliphate that they control. So when they do those things today, the US and the Saudis and the Emirates and others fight back in numerous ways. But we are very, very, very limited in what we can do once they have working nuclear weapons. And so even if they don't strike Israel (which they might, if they felt it could bring about their objectives), their possession of nuclear weapons would be hugely destabilizing for the region, and not in good ways.
The two most likely responses though are that Israel would strike Iran to prevent them getting nuclear weapons (which might require a pre-emptive nuclear attack by Israel, given the range) or that the Saudis would also obtain nuclear weapons in an attempt to balance the situation and limit Iran's options. Basically, the Middle East is in the process of descending into an even bigger mess than it has been the last century, or millenium depending on how you measure it, and the US is not only not the prime mover in this, it's basically being ignored by all sides.