IRAN'S invasion of Iraq has dismayed most coun tries of the region, not to mention more distant countries whose well-being depends on stability in the Gulf. It was bad enough when Ayatollah Khomeini was broadcasting his doctrine of Islamic fundamentalism among conservative Arab regimes vulnerable to revolutionary contagion and Shiite subversion. It is worse now that he has sent his army, the second most powerful in the region, across a national frontier.

The Israelis appear pleased. They note that the Khomeini regime has proved pragmatic enough to shop in Israel for military equipment. They hope the fear of Iran's rampant faith and force will distract their Arab adversaries and perhaps incline Jordan, for one, to deal with them.

Such expectations, however, run directly counter to the currents carrying the Khomeini revolution ahead. A leading Iranian complaint is that the Arabs have sloughed off their duty to "liberate" Palestine. This complaint is leveled even against the Iraqis, the Arab country most systematically hostile to "the Zionist entity." Alone among Moslems, Iran has sent soldiers to help the PLO in Lebanon, meanwhile excoriating the Arabs for their cowardice. To Ayatollah Khomeini, Baghdad is but a step on the road to Jerusalem. It takes a cool nerve, or a considerable myopia, for Israel to put the short- term advantage of the Iranian invasion over the longer-term risk of Iranian success.

But if it is too much to expect Israel, embattled as it is, to take the longer view, there should be no comparable hesitation among the Arabs and their friends. Egypt, seeing a chance to break further out of its Camp David isolation, is making a show of its readiness to assist Iraq with arms supplies. To the conservative Gulf regimes, which foolishly poured upward of $20 billion into Iraq to sustain its invasion of Iran, it should be worth far more to blunt Iran's invasion now. Can the ayatollah arouse Iraq's fellow Shiites? Will Iran's professional officers, or volunteer soldiers, fight as effectively in conducting aggression as they did in defending their own soil? Questions like these are critical.

Iraq's long antagonism to the United States removes the possibility of Washington's rendering direct support to Iraq. But the administration should be able to convey to and through friends like the Saudis its interest in restoring the territorial status quo and in turning the Gulf's conflicts to peaceful channels. Meanwhile, there should be no flagging in attention to the crisis in Lebanon. It is precisely because of the stakes in the Gulf that the Lebanese situation and the Israeli-Palestinian hostility behind it must be eased.