The drama of Trans World Airlines Flight 847, which looked initially to be just another Mideast aircraft hijacking, may now become a hostage-keeping test of wills that could bedevil the Reagan administration as the Iran hostage ordeal did its predecessor.

The latest events in this situation have made it much more complicated.

The hostages now seem to be dispersed to unknown locations, confusion has grown about who controls them and the United States and its Israeli allies are out of sync, imperiling a possible deal to resolve the problem.

As of last night, release of the Americans seemed increasingly bogged down in the internal politics of three countries and a hodgepodge of competing Islamic factions.

"We're not talking about a hijacking any more, but a new kind of hostage situation that has the capacity for lasting a long time -- days, weeks and conceivably even months," said Brian M. Jenkins, the Rand Corp. specialist on international terrorism.

Gary Sick, who was President Jimmy Carter's National Security Council expert on Iran and who recently wrote a history of Carter's Iranian Waterloo, said, "I feel very much the same sort of thing happening . . . . I'm worried the hijackers will escalate their demands as things go along."

The administration's main hope for an early solution is akin to a three-bank shot in billiards, in which timing and direction are in harmony.

First, the Israelis of their own accord, without any request from the United States, would have to begin releasing, or persuasively promise quickly to release, 700 to 800 Lebanese Shiite prisoners held in Israel.

Second, Israel's actions or assurance would have to be accepted by Shiite Amal leader Nabih Berri as a full settlement of the demands of the hijackers.

Third, the hijackers and whoever now controls the hostages would have to accept the word and the authority of Berri and release the captives at his direction.

While all of this seems possible, none of the steps were assured yesterday. In fact, there are grounds for serious doubt such a scenario is about to unfold.

The administration, making a choice that may prove extremely important, decided Sunday at the strong urging of Secretary of State George P. Shultz not to "make concessions" to the hijackers. Moreover, it resolved not to ask the Israeli government in any open fashion -- and, some officials say, any secret manner either -- to make concessions on behalf of the United States.

The Israeli government, for internal reasons, has asked for an explicit request from Washington before it releases the Shiite prisoners. Israeli politicians apparently feel they need a U.S. request to justify such a move to their people. Israel had planned to release the first 350 Shiites last weekend, before the episode of the kidnaped Finnish troops in southern Lebanon got in the way.

The situation in Lebanon is even more complicated, reflecting the factionalism, lack of authority and deepening chaos in that strife-torn country.

U.S. officials say they believe that the two hijackers who took over the TWA jet early Friday were southern Lebanese Shiites with little if any connection to any of the main organized groups.

When the plane returned to Beirut for the second time early Saturday morning, the officials think, armed men from two established but competing factions, Berri's mainstream Amal and the more radical Hizbollah, got aboard.

In a sense, the hijackers have been hijacked. The power relationship among the captors is, at this point, as obscure as almost everything else about the politics of Lebanon today.

The emergence yesterday of Berri in a negotiating role was the only hopeful sign for a possible early resolution, and the administration made the most of it. There was a danger, though, that Washington's praise for Berri's statesmanship could backfire by undercutting his fragile authority with the Shiite radicals.

Like most everything else in this act of guerrilla theater, Berri's posture was highly ambiguous. He is both a Shiite leader and a government minister, both a hostage negotiator and, by his account, a hostage keeper.

He is anything but a free agent or a secure figure, although he appeared to be the closest thing to a moderating force in sight.

But could Berri turn out to be the Sadegh Ghotbzadeh of this episode? Ghotbzadeh was for a time foreign minister of Iran during the hostage crisis there, a moderate who was willing to negotiate, but helpless to control the radicals who held the U.S. diplomats. Many officials, intensely aware of the agonizing developments of the 444-day Iranian hostage taking, are already beginning to measure the TWA hijacking against that recent history.

But there is another precedent with a different scenario that resembles what is happening now in Lebanon. This was the little-remembered hijacking in September 1970 of another TWA airliner and planes from Pan American World Airways and Swissair. All three were hijacked by the Popular Front for the Liberation of Palestine, a radical Palestinian group.

The three planes were taken to an airport near Amman, Jordan, where more than 400 passengers were taken off the aircraft. Two planes were then blown up. The Palestinians eventually released all but six passengers, who were finally set free in exchange for seven Palestinian terrorists being held in Switzerland, West Germany and Britain. This process took 23 days.

The hijackings triggered an armed confrontation between King Hussein's army and the Palestinian forces that led to ouster of the Palestine Liberation Organization from Jordan in what became known as the "Black September" of 1970. The transfer of the PLO fighters to Lebanon eventually led to the breakdown of authority, the Israeli invasion and the chaos that is the backdrop and perhaps a causal force in today's drama.

That episode is now a vague memory because it had the sort of benign ending that U.S. officials still hope is possible this time. But the Iran parallel is also an increasing possibility as this standoff drags on.