If recent history is any indication, the Soviet Union and Iran's current political courtship may be shortlived.

Iran's efforts to turn Moscow against the West might produce short-term benefits for both nations, but it could also result in headaches for which neither bargained. Bring on the aspirin.Ayatollah Ruhollah Khomeini, Iran's Islamic ruler, had unprecedented talks this week with Soviet Foreign Minister Eduard Shevardnadze, an Iranian move viewed in the wider political spectrum as trying to keep potential rivals at home and elsewhere off balance.

Past attempts at meaningful relationships between Iran and the Kremlin were strained, if not impossible, because of the Soviet Union's presence in Moslem Afghanistan and the Kremlin's support for Iraq during the Persian Gulf war. In any case, Iran has viewed the Soviets with suspicion ever since World War II when Soviet troops occupied a portion of the country.

In the best of circumstances, having Iran for a friend can be a volatile situation, liable to change overnight without warning.

Improved relations between Iran and Western nations began to brighten with the end of the gulf war, stirring beliefs that conditions were improving in Iran. But Khomeini did an about-face with his mandate for the assassination of Indian-born British author Salman Rushdie for blaspheming Islam in his book, "The Satanic Verses."

Britain had barely renewed diplomatic ties with Iran when the Rushdie incident exploded and everything fell apart. Diplomats of both nations have been withdrawn and an official break in relations is scheduled next week.

In his meetings with the Soviet leader, Khomeini said he welcomed stronger ties with Moscow to confront the "devilish acts of the West."

But that clearly was done more to taunt the West than out of any real friendship for their former Russian enemy. All it will take is some small offense in the eyes of the ayatollah and the Soviets could find themselves on the outside again.