Lebanese Prime Minister Shafiq Wazzan predicted today that the long-awaited agreement to end the Israeli siege of West Beirut was imminent and that the Palestinian guerrillas trapped in the broken city would begin their withdrawal by the end of the week "at the very latest."

The prime minister's optimism came after a meeting between Lebanese government leaders and U.S. special envoy Philip C. Habib, who returned today from Jerusalem with what he hoped were just a few minor points to be ironed out with Lebanese and Palestinian leaders before a final accord is reached. The Palestine Liberation Organization had no immediate comment on the negotiations.

[Senior Israeli officials, in their most optimistic assessments, echoed the Lebanese on the prospect of an imminent guerrilla exodus. They said that if the PLO turns over an Israeli pilot captured in the first day of the war and releases the bodies of nine soldiers they say were killed in the 1978 Israeli invasion of southern Lebanon, only "technical details" stand in the way of a formal evacuation accord, Washington Post correspondent William Claiborne reported from Jerusalem.]

[The way was cleared for final accord after Israel made two significant concessions in the two-month-long negotiations, withdrawing its objections to the deployment of a French contingent to the multinational force on the first day of the PLO withdrawal and lifting its objection to the presence of 10 U.N. peace-keeping force observers during the Beirut exodus, Claiborne reported.]

As a mood of almost palpable expectancy began to grip this battered city -- now in the 65th day of its siege by Israel, Wazzan told reporters, "I expect the implementation of the plan prepared by Habib at the end of this week -- at the very latest."

Wazzan and other Lebanese Moslem leaders predicted that final clarifications on several technical points raised by Israel yesterday could be worked out either tonight or Tuesday, allowing the Habib plan for the evacuation of up to 12,000 Palestinian and Syrian combatants from West Beirut to be approved by all parties before the Lebanese Cabinet meets Wednesday.

If approval is reached by then, the Lebanese Cabinet officially will ask the United States, France and Italy to send a 2,000-man military force to Lebanon to guarantee the withdrawal by sea and land of the armed PLO forces and a handful of their Syrian Army allies also trapped in the city.

According to European diplomats, once the call is made to the nations contributing to the international force, the first contingent -- expected to be a group of 350 French paratroopers already on alert at their base in France -- could be in Beirut within 48 hours. That would mean an evacuation could begin as early as Friday, although most sources said it might be several days later.

Officials involved in the negotiations with Habib were unusually close-mouthed about the clarifications and modifications requested by Israel yesterday. But it appeared that the only major issue still outstanding was an Israeli demand that the PLO hand over its lone Israeli prisoner of war, a pilot captured after his plane was shot down on the first day of Israel's invasion of southern Lebanon on June 6, as well as the bodies of nine Israeli soldiers. There was some confusion about the identities of the dead Israelis, and sources here said that they included five killed in the current invasion and four others who died in Israel's 1978 invasion.

Sources close to the PLO said that the Israeli demands should not present much of a problem. The PLO privately has expressed interest that the issue of the prisoner of war, Lt. Avron Achiaz, and the nine Israeli dead could be left for the International Red Cross to handle, since in the past that organization has mediated similar transfers of prisoners and military dead.

[The PLO and International Red Cross representatives made contact Monday about the exchange of the pilot and the return of the bodies, Agence France-Presse reported from Nicosia, Cyprus. The news agency quoted a Beirut radio report that cited former Lebanese prime minister Saeb Salam.]

The bodies of the five Israeli soldiers killed in the recent invasion are reported, by reliable sources who have seen them, in a PLO morgue in West Beirut. The PLO also has photographs of the four soldiers killed in a 1978 attack and is believed to know where they are buried in southern Lebanon, a territory now under Israeli occupation.

A message on the subject, and what were described as other issues of "not much importance," was being sent tonight by Habib to Salam who, as Habib's intermediary with PLO Chairman Yasser Arafat, is expected to discuss it with the PLO leaders tonight.

"It is my understanding from Mr. Habib," Salam said tonight, "that there is nothing of much importance still to be resolved."

Used to seeing moments of optimism dashed during the past two months, Salam said, however, that he was still not ready to proclaim the crisis resolved. "I want to see it with my eyes before I believe it," he told foreign reporters tonight. "I never trust the Israelis to do what they say."

Despite this conditioned skepticism, it was clear that even before the final agreement for the PLO evacuation is settled, Lebanese politicians were turning to business as usual, shifting their attentions increasingly from the crisis at hand created by the Israeli siege of their capital and occupation of nearly half of their country to haggling over who is to become the next president of this fractious and violent nation.

With the mandate of President Elias Sarkis expiring Sept. 23, the speaker of the Lebanese parliament, Kamal Assad, called late last week for a session of parliament Thursday to elect a new president.

Perhaps an even greater sign that Lebanon was returning to the chaos that traditionally, in times of peace, passed for normality, was evident in West Beirut today. For the first time in more than a month there were traffic jams on Hamra Boulevard, the commercial center of West Beirut. The streets were jammed with stalls selling everything from smuggled cigarettes to food. After more than a month of an Israeli blockade of electricity, water, fuel and fresh fruits and vegetables, Lebanese businessmen, long accustomed to smuggling, clearly had found a way to break the Israeli blockade, at least to get fresh food supplies. Lebanese drivers spoke of five trucks having been brought in for the past two days full of fruits, vegetables, eggs and cattle and sheep.

Outside West Beirut, however, Israeli soldiers turned back an emergency consignment of 4,400 gallons of diesel fuel for the American University Hospital, Reuter reported. The Red Cross, which arranged the delivery, said Israeli commanders outside Beirut gave permission for the fuel to enter, but officers at the checkpoint said they had no such orders.

[It was the first time the Red Cross had tried to get fuel into the western sector of the city. Informed sources told Reuter that Israel agreed to consider letting the tanker in only after appeals from Washington.]

Correspondent Claiborne added the following from Jerusalem:

An informed Israeli official said that "if everything goes smoothly, and the pilot and the bodies of the soldiers are returned, it [preparations for the withdrawal] can be finished very quickly."

He added that the outstanding technical details involve the precise positioning of the multinational force and the exact time of its arrival, the positioning of the token U.N. observer force and logistical questions such as the route the guerrillas will take out of the city and the transportation arrangements being made by the Lebanese Army.

Israel's acceptance of the French contingent to the 2,000-member multinational force came after French Foreign Minister Claude Cheysson telephoned the Cabinet Sunday with a commitment that the French government would withdraw its first contingent of 300 to 400 troops if the PLO reneges on its promise to leave Beirut and Lebanon. Israel had adamantly opposed the deployment of the French force before most of the guerrillas leave, warning that it would be a shield against Israeli Army action against the guerrillas if the evacuation collapsed.

It is understood that the French contingent, which is to be joined later by U.S. and Italian contingents, is to be stationed primarily at two exit points, the Beirut port and a land transport terminal yet to be determined. The troops will not be deployed throughout densely populated West Beirut, through which the departing PLO fighters will travel, according to the understanding.

Another sticking point in the negotiations was overcome when Prime Minister Menachem Begin dropped his demand for a copy of a list of identities of the guerrillas to be evacuated to Syria, Jordan, Iraq and several other Arab countries. Israeli officials said that, instead, the list will be handed to the Lebanese Army, which will help supervise the withdrawal.

On the issue of the return of the pilot and the dead soldiers, Begin and Defense Minister Ariel Sharon had told Habib yesterday that Israel would not consider a compromise. They said the return must be completed before the evacuation begins, but that the question of approximately 7,000 PLO guerrillas being held in Israeli prison camps in Lebanon could be raised with the Red Cross after the evacuation.

Israel is also understood to have assured Habib that when the evacuation begins, all Israeli Army roadblocks on the Beirut-to-Damascus highway will be removed to allow the Syrian Army troops still trapped in West Beirut to withdraw through the Bekaa Valley.

[State-run Damascus Radio said Monday that Syrian forces would not pull out of Lebanon under Israeli threats but would defend their presence there, Reuter reported. The commentary made no mention of Beirut.]

In what appeared to be an additional concession, the Israeli Army radio said tonight that Israeli forces withdrew from the parliament building in Beirut and turned it over to the Lebanese Army.

In a surprise move, the Israeli Army closed the Israeli-Lebanese border to U.N. peace-keeping force traffic today, trapping on the Lebanese side about 250 staff members who commute daily to Nahariya on the Israeli side.

Timur Goksel, spokesman of the U.N. Interim Force in Lebanon, said that despite repeated inquiries, the Israeli Army command offered no explanation for the move.

An Army command spokesman said tonight that he had no information about the incident. However, military sources confirmed tonight that the border had been closed during the day to U.N. personnel for unspecified "security reasons." They said the closing was being lifted tonight.