Honestly Iran really shouldn't have ever been working on the bomb or really for that matter funding terrorism across the middle east. Like seriously had those moronic idiots running the place spent that cash on oh I don't know making it so their economy isn't utterly dependent on oil sales to not go under and beefing up their own conventional armed forces they'd be the dominant regional power. And honestly if they didn't keep doing this dumb shit by now I suspect the US would have probably been willing to restart a relationship with Iran. Instead they get all the sanctions and have pissed off all their neighbors and it they ever test a nuke the sanctions they have on them now will seem a pleasant memory.
That raises a great topic - resource curse and its consequences in a long and curvy way creating the alliance of Iran and Russia. Through very different roads, they ended up in the same camp, led by the same incentives.
Take a country that has some industry and technology but it's not good enough at it to go commercial worldwide, add huge oil revenue for the government, add lack of democratic tradition, and an imperial history...
You get a government that has little interest in advancing its mediocre industry into something competitive on the world scale, after all success is hard and not assured, they can buy almost anything they want for oil money, in that case why even care about having a happy and prosperous population of high skilled workers, not many jobs for them anyway, and if the smart ones leave, who cares, less whiny complainers who think they can run the government better and less competition for oil revenue in government, just care about the local fanatical potential muscle dreaming of return to empire and regime honchos that need to be kept happy instead.
So in the end the country drifts towards an economy focused on resources and making military related stuff that's under sanctions or soon will be, the rest can be bought, and not many people even need to have it bought for because most are not important, like serfs, their opinions don't matter, at worst some will fuck off for greener pastures, but they have plenty to spare. With a system like that, it's left for the local fanatics, wannabe glorious leaders and other assholes to use the population of serfs and black gold funded war chest to fight themselves out a place in the history books, attempts at which keep the successfully propagandized parts of the population as loyal praetorians.
The moronic idiots in charge currently are stuck riding the train of Shia fanaticism and "islamic revolution" until its end, whatever it may be, whether they like it or not, for that is where their relevancy ends, that is synonymous with their whole claim to power and appeal to their power base. Without that whole myth and pursuing it (which includes exporting the revolution), they may as well go back to pre-revolution foreign policy, being allies with USA and Israel even, which makes their whole revolution that got them where they are utterly pointless, and of course declaring their whole political program a pointless mistake is the last thing they will ever do.