More than 30 Americans who remain on a hijacked TWA airliner found themselves back in Beirut for the third time today after being held hostage by extremist Shiite Moslem gunmen for three terror-filled days.

The plane's return set off another round of negotiations and statements, including an appeal to President Reagan, apparently signed by 30 American hostages, not to use force to obtain their release. But even as the plane landed, firing around the airport reflected the tensions of this war-torn city.

As the Boeing 727 neared Beirut this morning on its second flight from Algiers in an 8,500-mile ordeal that began above Athens Friday morning, the airport control tower asked pilot John L. Testrake whether he knew that he had no permission to land and that the runways were blocked.

"Yes," the pilot replied, "but we have no choice, we have no choice. The hijackers have insisted that we have to land here regardless, even if we have to crash the aircraft."

Officials then ordered four orange fire trucks to be driven off the runways. The pilot radioed that he had enough fuel for 13 or 14 minutes and was asked to hover over Beirut for five minutes before he was given the go-ahead to land.

The airliner had left Algiers one hour before expiration of a deadline set by the hijackers for fulfillment of their demands.

As the plane touched down here, antiaircraft guns were fired in the direction of an Israeli gunboat offshore. Mountain-based gunners backing Palestinian guerrillas besieged in refugee camps just north of the airport rocketed Shiite positions nearby as the aircraft rolled to a stop south of the terminal.

The hijackers then called for food and water and asked Lebanon's most prominent Shiite politician, Justice Minister Nabih Berri, to represent them in negotiations.

Berri, who heads the Shiite Amal movement, was in contact with U.S. Ambassador Reginald Bartholomew, official sources said. Berri also met with Interior Minister Joseph Skaff and French Charge d'Affaires Marcel Laugel and conferred by telephone with the Spanish ambassador here. The hijackers, who have demanded the release of about 700 Lebanese Shiites held in Israel, today added a new demand that two Lebanese jailed in Madrid in connection with an attempted assassination be sent to Damascus or Algiers.

Berri said that he had agreed to act as negotiator after receiving a commitment by the hijackers not to harm anyone if their demands are met.

After talking with Berri, the diplomats said they would relay the hijackers' demands to their governments. The hijackers had requested to meet with envoys from the United Nations, the Red Cross, the Interior Ministry and the ambassadors of France, Britain and Spain.

The hostages' appeal to Reagan came in a brief, hand-scrawled message given to an Amal negotiatior, Bassam Tleiss, who boarded the aircraft at least twice.

"We the undersigned 32 American hostages aboard Flight 847 are writing you freely, not under duress," the note said. "We implore you not to take any direct military action on our behalf."

The note had only 30 signatures, and one of these was not on the list compiled by TWA. In addition to the Americans, there still are several Greek passengers on the plane, including singer Demis Roussos.

The signers of the note asked Reagan to "please negotiate quickly our immediate release by convincing the Israelis to release the 800 Lebanese prisoners as requested. Now." The word "now" was underlined. Previously, the number of Shiites held by Israel had been given as 700.

The hijackers, who had released more than half of the passengers in Beirut and Algiers Friday, Saturday and this morning, vowed not to let anyone else leave the plane unless their demands were met. At about 8 p.m., however, they urged representatives of Amal and Transport Minister Walid Jumblatt, a Druze, to send an ambulance to the plane. "There is an old man here who is very sick," a hijacker said. "He is very dizzy and he needs care. That's the only reason why we are letting him go. Send an ambulance. Hurry up. Hurry up."

Bob Peel, 58, of Hutchinson, Kan., said he had cracked his ribs in a shipboard fall before boarding the plane in Athens. "I was flying home," he said, lying on his stomach and holding a piece of cotton to his nose as he arrived in a Red Cross ambulance at the entrance of the American University Hospital emergency room. A son, Bob Peel Jr., remained aboard the plane.

In a statement read to the control tower earlier, the hijackers said, "We are not war criminals and we are not air pirates. We are asking for rights that have been stolen by Israel and America. And these rights can only be regained by force of arms."

The hijacker said the communique was the fourth issued since the operation began and that there would be a "fifth and final one. The statement issued after that will not be a communique."

The hijacker, speaking with emphasis and repeating his phrases, said, "We are not ready to release any of the remaining hostages. And our blood will testify to this if there is any delay in the release of our brothers held in Israeli prisons."

The statement urged the Red Cross "to act and to act quickly, before it is too late . . . ."

The hijackers' statement expressed willingess to negotiate further and hold more talks to obtain the "approval of America and Israel." It recalled that the International Committee of the Red Cross had been allowed to visit the aircraft in Algiers. "This is the first time something like this happens during a hijack operation. We also released three of the American hostages" this morning in Algiers.

The hijackers said that in return, "50 Lebanese prisoners should be released from Israeli prisons."

In addition to freedom for the Shiite prisoners, the hijackers have demanded an end to bloodshed in Lebanon and condemnation of U.S. and Israeli policies in the Middle East.

Scores of tough-looking Shiite Amal gunmen were at the airport. None of them approached the plane, as they had done during its second stop here early Saturday.

On that stop, at least six American passengers with Jewish-sounding names were removed from the plane and are still missing. The body of an American killed aboard the plane and thrown onto the airport tarmac early Saturday was flown today to the U.S. air base at Torrejon, Spain, for identification.

When darkness fell tonight, the lights of the plane were shut off. Shortly before 11 p.m., bursts of shots were fired as the hum of airplanes was heard overhead. Flares were dropped to illuminate the airport and shore. Radio stations said there were fears of Israeli activity. Nervous militiamen, fearing an Israeli operation to storm the aircraft, fired at a vessel sighted offshore and escorted by a helicopter. The vessel stayed close to the shore just south of Beirut, only retreating when fired on.

However, Berri ordered Amal to go on alert. The control tower told the hijackers that "strange targets" were flying in from the south and suggested that they refuel the Boeing 727. [In Paris, a TWA spokesman expressed concern that the plane was nearing "its physical limit" after the number of flights it has made without servicing.]

A spokesman for the hijackers asked militiamen to redeploy between the plane and the coast, about 500 yards away.

Hijackers' demands concerned more than Shiite prisoners. One of the gunmen shouted to officials, "We asked for chicken sandwiches."