Part of Iran's problem in deciding whether to retaliate for the Fakhrizadeh assassination is the fact that any thing it does will be portrayed as "terrorism" rather than a legitimate right to retaliation.
The bottom line is that there are two classes of nations in the world. The ones that can do stuff like send in kill teams to assassinate physicists in another country and can still be viewed as part of the civilized world, and countries, like Iran, that can't. Among mainstream leaders in the West at least, Israel is not going to be deemed a terrorist state for this operation, just like no one would ever call the U.S. a terrorist state if it temporarily knocked out the power for thousands so a civilian scientist can be slaughtered by the side of a road, as long as Israel or the U.S. does it in a place like Iran. Most European countries could do the same operation without getting accused of terrorism. Oddly enough, those assassinations are often covered as "anti-terrorism" even when a civilian is the target.
But imagine for a moment what would happen if Iran had gunned down a physicist on the streets of New York or Tel Aviv, even if the physicist was helping the U.S, or Israeli government build a nuclear weapon. The entire world would join in its condemnation of the "terrorist attack."
Iran is stuck. It keeps getting attacked and its attackers are always assumed to be on the side of the good guys. If Iran lets it go, it just encourages more attacks. But if it tries to fight back, it is viewed as proof of Iran's moral perfidy (and can even serve as a retroactive justification of the original attack). Normally, I would say that Iran's only good choice is to try to negotiate with the people attacking, agreeing to drop their right to retaliate (which would backfire anyway if they actually tried it) in exchange for some concession that might move them closer to being treated as a regular country and not just a target for slaughter. But the Netanyahus and Republicans of the world have effectively ruled out that option too.
Given all that, maybe their only real choice is to get a nuclear weapon? They need to get these attacks to stop and conventional deterrence can't work. So that leaves nuclear deterrence. Hey, it worked for North Korea. No one is going to poke that wasp nest now.