To be fair to the Peanut Farmer and Reagan, the Soviet Union had heavily backed Iran. If either attacked Iran, it might triggered the type of war nobody wanted.
However after the Berlin Wall/Iron Curtain fell, there were no more excuses to take care of Iran once and for all.