A decade-long policy of letting all sides in the many Middle East disputes operate in Cyprus with virtual freedom suddenly came apart last week in the terrorist slaying of an Egyptian editor and the bloody battle that followed at Larnaca airport.

Now Cyprus, which had allied itself with the growing power of Arab petroleum and tied its economy closely to that of the Persian Gulf, is worried about its future relations not only with Egypt but with the entire Arab world.

A current and bitter joke making the rounds is that two Arab terrorists killed an Arab editor and took Arab hostages and then when an Arab country intervened without permission and Arab soldiers were killed, it was Greek Cypriots who were to blame.

The repercussions of last Sunday's battle at the airport, in which 15 Egyptian commandos were killed in a shoot-out with the Cypriot National Guard while attempting to storm a commandeered plane, are still reverberating through this small, divided island republic.

Although the cabinet and major party leaders have expressed their public support for President Spyros Kyprianou's handling of the affair, Cypriots are nonetheless asking themselves how they got into such a mess.

It was the late Cypriot President Archbishop Makarios, a major figure in Third World politics, who first decided to allow virtually all the factions of Middle East politics to roost on his island as long as they did not befoul his nest. He put a stop to a series of Arab-Israeli killings on the island in the early 1970s and maintained diplomatic relations with both Israel and the Palestine Liberation Organization.

Despite the bitterness of the 1975-76 Lebanese civil war, virtually all factions operated freely on Cyprus without murdering each other. The Christians, for example, supplied their side out of the port of Larnaca while the PLO and their friends used the port of Limassol -- while the Cypriots made money off both.

In the meantime, Makarios hitched his wagon to the rising star of Arab petroleum power, especially after the Turkish invasion of 40 per cent of the island in 1974. Trade relations with Egypt also have risen sharply in recent years.

But this delicate, best-of-both-worlds balance depended on the personal authority of Makarios to keep the factions of the Middle East from each other's throats and, secondly, it required a measure of Arab unity. The death of Makarios last summer ended the first factor in this balance and the current split in the Arab world, due to the Egyptian peace initiative, destroyed the second.

Therefore it was not altogether surprising that the more violent aspects of Middle East politics should erupt here.

Egyptian President Anwar Sadat has vented his fury over the incident where it hurts most: not only has he broken diplomatic relations with Cyprus but he has also withdrawn recognition from Kyprianous as its legitimate president. This is particularly painful because the 40 percent of Cyprus under Turkish occupation likes to call itself the "Turkish Federated State of Cyprus" and does not recognize Kyprianou as president of all Cyprus.

Although Cyprus still says the Egyptian commandos did not have permission to storm the hijacked plane, and indeed the Egyptians have admitted as much by saying they made the decision to attack only when they thought the Cypriots were going to release the hijackers in exchange for the hostages, Cyprus has been leaning over backwards to take a conciliatory tone. Kyprianou's first public reaction was to say that he understood Sadat's strong feelings and that his anger was a "justifiable psychological state."

Egypt has said that future relations would depend on how Cyprus "behaved" in regard to the two Palestinian terrorists. Although Cypriot law does not allow Kyprianou to hand them over to Egypt as Sadat first demanded, they are to be brought to court tomorrow to be charged with premeditated murder of Sadat's personal friend, the Egyptian editor Yussef Sabai, who was gunned down in the lobby of the Hilton hotel here Feb. 18.

Cyprus officials take some comfort from the fact that no other Arab state has followed Egypt's lead in breaking relations nor is it deemed likely that Sadat will recognize the "Turkish Federated State of Cyprus," which is recognized by Turkey alone.

Nor would it appear that the Larnaca affair will seriously affect the current efforts to reach a compromise between Greece and Turkey on the Cyprus question.

President Carter's letter to Sadat praising him for his "courageous decision" to launch the attack, however, has not improved Cypriot relations with the United States.

Although it seems clear that Egypt did not have permission to attack the plane, Sadat's personal fury at the plane, Sadat's personal fury at the murder of his friend -- and his wish to show a strong hand against the long-predicted violent reaction of Iraqi-based Palestinians against Egyptians because of Sadat's peace plan -- seems to explain the action. But the question remains, why was it necessary for the Cypriots to open fire?

It is alleged here, especially on the right, that Kyprianou bungled the affair and put too much authority into Socialist EDEK party during the negotiations with the hostages.

Lyssarides is described by diplomats here as perhaps the most strident voice in Cypriot politics in favor of the radical, rejectionist Arab states and he is accused of having ties with Libya.

Lyssarides became involved because he was the Cypriot chief delegate to the Afro-Asian People's Solidarity Organization conference which was the target of the terrorist attack. He was in the hotel when one of the organization's founders, Editor Sebai, was killed.

Kyprianou was in Athens at the time and Lyssarides was, in effect, the host of the conference. As radical Arabs were Lyssarides' friends, the president apparently decided to let him play a major role in the negotiations once the terrorists had taken their hostages aboard a Cyprus Airlines plane.

The situation grew more complicated and dangerous when PLO leader Yasser Arafat sent his own commando team to Cyprus on the instructions of Lyssarides.

Although it is clear that some of the Palestinians got involved in the shooting at the airport, they wer not sent to thwart the Egyptians and were standing by to help the Cypriots if asked. Arafat, no less than Sadat, wanted to get his hands on the two terrorists. They are believed to belong to a branch of Palestinians who are against Arafat.

Cyprus has long identified with the Palestinian cause. As one official said Friday, Cyprus sees some parallels with the Palestinian problem and their own with Turkey -- "refugee problems, repression and foreign intervention."

But the past policy of allowing every faction of fractious Middle East politics to use Cyprus as a base is partly responsible for last Sunday's fiasco and explains Kyprianou's plea that the Arabs not use Cyprus as a battle ground.