Are you saying it would only be used to face down threatened attacks on Iran?
No, I'm saying Iran having a viable nuclear deterrent would prevent nearby neighbours from continually sabre-rattling at Iran and bullying Iran-aligned states, because the possibility of escalation would not only deter Israeli aggression, but it would also make the US and European supporters of Israel far more likely to intervene, far less keen to assist Israel with Intelligence and financial support, and leave Israel in a position where it genuinely couldn't afford to go throwing its completely artificial weight around the way it has been doing for decades.
The reason Iran is continually prevented from developing it's nuclear industry is nothing to do with threat to Israel, although that's how it's invariably sold by western and Israeli propaganda. It's entirely about maintaining the total imbalance of power in the middle-east because it suits Western and Israeli interests to maintain the status quo. In the meantime, it's innocent people in Gaza, Lebanon, Israel, and Iran who will continue to be killed, but since it's overwhelmingly Muslim and Arab casualties, there is no genuine desire in the nations that could bring this to a halt for the situation to change.
Netanyahu himself has openly stated he sees no way to end this until Israel effectively ethnically cleanses the region, and he'll continue to use the IDF as his tool to do that, because there is no will to stop him anywhere that actually could stand up to him or give him pause for thought. A nuclear capable Iran would do just that.