During the period in which the shah of Iran ruled by royal decree, he banished Ayatollah Ruhollah Khomeini from Iran.

The ayatollah's revolutionary activities had made him a pain in the royal neck.

Khomeini went to Iraq. While there, he continued to agitate against the shah, and was therefore invited to move on. Eventually, he was given sanctuary in France with the understanding that while he was in exile there, he would not engage in political activity.

Nevertheless, from his French headquarters the ayatollah continued to urge the Iranian people to overthrow the shah. And eventually they did. The ayatollah returned to Iran in triumph, and the shah became the outcast. The wheel of fortune had turned 180 degrees.

The shah also had difficulty in finding a new home. As the ayatollah had done, the shah took temporary refuge in several places before he found a suitable place for more permanent residence.

Once he arrived in Mexico, he lived quietly and had little to say for publication.This arrangement seemed to have the tacit approval of the new Iranian government. The ayatollah made no demand for the shah's expulsion, nor for his return to Iran to stand trial.

Suddenly, the picture changed. When it was announced that Pahlavi was ill, the ayatollah wished him a speedy death. It was not the kind of charitable comment one expects from a clergyman.

When it was learned that the deposed shah would be admitted to this country for medical treatment, Khomeini complained bitterly and roused his countrymen to demonstrations of protest that culminated in the seizure of hostages at our embassy.

In due course, the ayatollah's fury and the rampaging mobs in Tehran's streets had their effect.The Mexican government told Pahlavi to find another home.

News dispatches were filled with speculation as to where that new home might be. The outcast was not welcome anywhere.

In all of this speculation, I have not seen a single word about France. It might seem appropriate that the nation that had given sanctuary to an ayatollah fleeing from a shah might, now that the wheel had turned, give sanctuary to a shah fleeing from an ayatollah. But apparently this is not to be.

Admittedly, there are differences between the two men. Their transgressions have been different in kind and in degree.

For one thing, there is reason to believe that the shah enriched himself at the expense of his people; there is no evidence that the ayatollah has been guilty of such an offense. On the other hand, the shah conformed to civilized rules of conduct that protect the lives of diplomatic personnel; the ayatollah has not.

These differences, and perhaps others, may be the basis for France's present uninterest in the shah.

But there are also striking similarities between the shah and the ayatollah.

Neither has headed a democratic regime. Both have ruled as dictators. Both have been responsible for summary executions. Impartial newsmen have reported that "thousands" of people were killed for anti-shah activities. Hundreds have already been killed under Khomeini's brief rule.

As President Carter properly pointed out, the ayatollah has a right to bring charges against the former shah. But he does not have a right to hold American diplomatic personnel hostage pending the outcome of such legal action.

When the ayatollah demands that Pahlavi be returned to Iran for trial and punishment, he makes it clear that the outcome of such a trial would be a foregone conclusion.

If Pahlavi goes back, he is a dead man. If he waits outside Iran for an international tribunal to rule on his guilt or innocence, he must have a place in which to wait. Everybody has to live somewhere, even temporarily.

But Mexico, a traditional refuge for political exiles, doesn't want him. The United States, which has always offered asylum to refugees, faced a difficult decision in accepting him merely for temporary medical treatment. France, which prides itself on being the cradle of liberty and which admitted the ayatollah, is pretending that it never heard of the shah.

There must be a way out of this dilemma, but we have not yet found it. To us, the solution appears to depend upon the prior release of the hostages. But there is no indication that the ayatollah will change his mind about that.

Even worse, to the ayatollah the solution appears to depend upon our prior agreement to deliver the shah to Tehran, preferably in chains. And there is no indication that the American people will change their minds about that.

So where do we go from here?