Nabih Berri's plunge into the tricky task of negotiating the release of 40 American hostages from a commandeered TWA airliner appears to have boosted his standing on many levels.

The leader of the Shiite Amal movement, in his starring role on an international stage provided by American media, has consolidated his position within his own organization and strengthened his uneasy relations with the more radically fundamentalist Hezbollah group.

A close adviser to Berri noted that failure by Israel to free 735 Lebanese prisoners from its Atlit Prison, or any retaliatory U.S. military action, could negate quickly Berri's perceived gains and jeopardize his position.

The adviser, Zuheir Berro, noted that prompt release of prisoners by Israel should improve Berri's relations with Hezbollah. The two hijackers of the plane are said to belong to that group.

Hezbollah, with an estimated membership of 3,000 to 4,000, has challenged Berri's authority. Berro acknowledged that initial contacts with Hezbollah leaders to resolve the hijack drama were difficult but they soon became aware that the Amal leader could play a role in helping them resolve the crisis.

Serious differences persist, however, between the two Shiite groups. The hijacking has not resolved conflicts over regional alliances, with Hezbollah veering closer to Iran than Amal, or arguments about the precedence of religious over secular authority

Amal, under the stewardship of Berri, a18992 spokesmen say their aim is eventual creation of an Islamic republic.

Amal's management of the hijacking showed that it can cooperate with Hezbollah on key national demands and it also undercut an impression that Amal had made a deal with the Israelis, said Berro. Hezbollah officials were reluctant to give Amal or its leader any credit for taking over the negotiations on behalf of the hijackers.

Amal hesitated to enter the hijacking episode but Berri felt compelled to do so, Berro indicated, when an irate hijacker on June 15 shot an American passenger to death.

The biggest plus in the outcome for Amal may be the media spotlight it threw on Berri and his representatives, providing them with a forum to air Shiite and Lebanese grievances over Israeli actions in southern Lebanon.

American public concern about the welfare of the hostages helped focus attention on U.S. policy in the Middle East concerning Lebanon. Berri could not have asked for a better opportunity to educate the American public, one observer said.

Berri's politicizing of the hijacking and shifting it from a simple question of terrorism to one also touching on Shiite suffering and charges of Israeli injustice has gained him prestige here.

Berri said on Lebanese television tonight that his and Amal's involvement in the American hostage crisis was arduous, but a great asset because "it will bring the mujahideen holy warriors back to their families and because it has restored some dignity to international law." He was referring to Israel's alleged violation of Geneva Conventions with the transfer of detained Lebanese into Israel.

Another significant development came with Syria's entry into the picture -- and Washington's seeming recognition of Damascus as an effective regional power. Syria acted as middleman among the United States, Amal and the hijackers.

Berro offered this lesson from the hijacking: Continued Israeli occupation of Lebanon could upset not only the stability of Lebanon, but of the Middle East.

Whatever happens in the Middle East, it cannot be kept far from Syria, Berro added. He stressed that the protracted hijacking made the Americans and Israelis reconsider the issue of southern Lebanon. Israel has yet to complete a third and final withdrawal phase that has been stalled by disagreement over a role for the Israeli-backed South Lebanon Army.

Berro stressed that the hijacking was part of the struggle against Israel and America and warned that this struggle would continue as long as there were Israeli soldiers or collaborators in southern Lebanon.

Another apparent benefit of the successful mediation for Syria and Berri is that it has overshadowed blunders committed in a month-long battle between Shiites and Palestinian guerrillas in Beirut's refugee camps.

All this said, Amal's task of improving conditions for the Shiite community remains unachieved. The Shiites have gained some military and political victories but nothing solid on which to build a better life, said a U.S.-educated Shiite Moslem close to Berri. He noted that Amal was a loose organization, with many members and few able leaders: "It's like an elephant with the brain of a mouse."

Conceding that Amal was full of people who were loyal to other sides, particularly Hezbollah, the adviser described them as fighters with mixed feelings.

Despite Amal hopes for better ties with that radical group, there are signs of tension. A fist fight broke out in the Bekaa Valley two days ago during a funeral for Amal commander Adnan Hilbawi, who had been wounded in the first day of the camp war. The brawl was triggered by the reference of Amal Politburo chief Akef Haidar to Iran's Ayatollah Ruhollah Khomeini as the leader of the Shiites, while a Hezbollah speaker said the Iranian was the leader of all Islam.