Iran taking USD bribe instead of obtaining nukes made it worse for them in long run.
They can look at Ukraine who bitterly regrets giving up their nuclear weapons, or North Korea, seemingly invulnerable despite being the most pariah of pariah states.
From the perspective of the Iranian state, it would be idiotic and irresponsible not to try to make a nuclear weapon in these conditions.