Syria today defended the controversial presence of Soviet-built ground-to-air missiles in eastern Lebanon, but left a possible loophole for a negotiated settlement of the crisis.

As U.S. presidential envoy Philip C. Habib plunged into his three-nation mission here, a Syrian Defense Ministry spokesman in Damascus issued a statement suggeting that the missiles might not be needed in Lebanon if Israel halted its air raids against targets there.

The Syrian statement said: "Air defenses, including missiles, are part of the Syrian armed forces. They are present now and will be present in the future in any place where Syrian troops are present when they need them." Previously Syria has not held out a possibility of removing the missiles.

Issued after Geory Kornienko, Soviet first deputy foreign minister, ended three days of talks in the Syrian capital, the statement appeared to observers here to form the basis of the Syrian negotiating position.

The leftist Beirut newspaper As Safir had said this morning that the Soviets advised Syria to make a deal to remove the missiles in return for a cessation of Israeli air raids.

Syrian Foreign Minister Abdul Halim Khaddam has said the missiles in Lebanon's strategic Bekaa Valley are purely defensive that the real problem is Israeli air raids against targets in Lebanon.

Israel has demanded the withdrawal of the SA6 missile batteries and threatened military action if Habib's mission fails.

Israeli prime minister Menachem Begin justified the shooting down of two Syrian helicopters Arpil 29 by saying they were being used to crush his Lebanese Christian allies in the fighting around the Lebanon Mountain ridge line in eastern Lebanon. The missiles were moved in the next day.

Begin and other Israeli officials have said their reconnaissance flights and preemptive air strikes are necessary to fight the Palestinian guerrillas.

The Syrian defense spokesman said Israel's real motive in shooting down the helicopters was to "disrupt" the negotiations between Syria and the Lebanese factions, which began the same day.

The spokesman said the helicopters were not on combat missions, but were carrying provisions to troops. They were shot down, he noted, after a cease-fire had gone into effect about 24 hours earlier, with the Syrians and their Lebanese allies in effective control of the disputed ridges.

Habib, a former under secretary of state, is to go to Damascus by car Saturday for meetings with Syrian officials, including President Hafez Assad.

Today, after conferring with President Elias Sarkis and Foreign Minister Fuad Boutros at the presidential palace at Baabda near Beirut, Habib described the Lebanese situation as "dangerous."

Just after his armored limousine cleared an often perilous crossing on his ride to the office of Prime Minister Shafik Wazzan, in predominantly Moslem West Beirut, shooting broke out, forcing other cars in the motor-cade to take a more circuitous route.

Earlier, four mortar rounds his near the prime minister's office. By mid-afternoon Syrian and Christian forces were exchanging artillery fire. The outbreak was the most serious in more than 10 days.

Habib also met with several Christian and Moslem politicians, some of whom head the militias that have been fighting here for the last six years.

In general, the beleaguered central government and the Christian militias have been pleased with the Habib mission, which they consider overdue recognition of U.S. reponsibility in seeking to end the violence.

Habib received three separate Christian delegations at Ambassador John Gunther Dean's residence and met privately with overall militia commander Bashir Gemayel.

Leftist politicans and commentators have been less friendly. WAFA, the Palestine Liberation Organization's news agency, wrote, "The United States can be neither arbiter nor a mediator for it is one of the foremost parities involved," because of its traditional support of Israel.

From remarks made by those he saw, it appears that Habib indicated U.S. willingness to solve problems between the militias and Syria, especially around the besieged Christian city of Zahle and on the crucial ridgeline overlooking it.