Even if U.S. special envoy Philip C. Habib has succeeded in solving the West Beirut crisis and arranging for the evacuation of Palestinian guerrillas, U.S. involvement in this country's affairs is far from over, according to diplomats and analysts.

Known as "the magician" to his admiring foreign colleagues, Habib so far has refused to deal with anything but the problem of West Beirut and the Palestine Liberation Organization's presence here.

Cleverly giving the guerrillas enough time to salvage face, if not political victory, from their military defeat, then in turn demonstrating to Israel the costliness of a major ground assault, Habib has changed the balance of power and shown both protagonists the advantages of compromise. NEWS ANALYSIS

Left purposely vague is what exactly constitutes a guerrilla. The Israelis, if they want to, can claim they have smashed the "center of international terrorism" and thus achieved one of their expanded war aims.

The PLO can say that remaining in Beirut will be a number of part-time guerrillas who can -- in theory at least -- take up the cause at some future date.

But loose ends -- great and small--abound. That was only natural once the United States saw fit not to stop the Israeli Army from expanding its original war aim of smashing the guerrillas within cannon range of the Israeli-Lebanese border.

The overriding question for U.S. policymakers is how serious they are about their oft-repeated pledge to strengthen the central government of this country, which has been sapped by decades of misrule complicated by civil war, foreign occupation and other major ills.

A strong central government was and is a stated Israeli war aim as well. But, increasingly, voices here and in Israel question whether Prime Minister Menachem Begin intends to carry it through.

Specifically, specialists close to the Israeli government have suggested a division of Lebanon, with the Syrians taking the Bekaa Valley and the north -- and perhaps even getting back part or all of the Golan Heights -- and Israel exercising dominion in the south and, by extension, in the Christian-dominated mountain region.

On paper, such a solution is a logical conclusion now that the weakest partner of the previous division -- the PLO -- is no longer a meaningful player in the game.

In this scenario, the Israelis would make do with their 25-mile-deep demilitarized zone -- an unthinkable plus for the Jewish state before the war -- and man it with Lebanese surrogates, much as they paid, armed and encouraged cashiered Lebanese Maj. Saad Haddad in a narrow border strip before their June 6 invasion.

In that process Israel's alliance with Bashir Gemayel, the leader of the right-wing Christian militias in the north, could suffer. The Israelis make no secret of their disappointment that Gemayel did not join them in fighting the PLO and have shown so in public by openly encouraging Haddad's men at Gemayel's expense.

Israel may figure, moreover, that its invasion compromised Gemayel so badly with Lebanon's Moslems that realistically he cannot hope to win the presidency he seeks.

With the presidential election due to take place by Sept. 13 -- roughly the date by which an American, French and Italian force would be in Beirut, ostensibly to supervise the PLO evacuation -- the United States hardly could escape its role as a "grand elector." At least that is the view here.

So time-honored is foreign intervention in Lebanese politics that most Lebanese believe the United States is backing its own presidential candidate. Until recently, Israel made little secret of its desire to have Gemayel elected, then persuade him to sign a peace treaty.

Whether the United States favors such an outcome remains obscure, despite nominal denials of interest in anything but the democratic process itself. Increasingly there is talk of extending incumbent Elias Sarkis' six-year mandate for a year or two to avoid an election under Israeli bayonets.

Were Israel disappointed in the election results -- decided by the 92 remaining members of parliament elected in 1972 -- analysts believe Begin may concentrate on forging links with the Shiite Moslems in the south. They make up 70 percent of the population within the projected demilitarized zone.

All such thinking, of course, is based on the assumption that the United States will not take an active role in forcing both Israeli and Syrian armies to leave. Achieving such a major goal would require enormous will and political muscle of a kind the United States has refused to invest in Lebanon for a generation.

Without an Israeli willingness to withdraw totally from Lebanon -- something Israel has refused to do despite repeated U.N. Security Council resolutions since its earlier, 1978 mini-invasion -- it is hard to imagine a withdrawal of Syrian forces.

Seemingly, the first task facing the United States after the West Beirut crisis is defused will be to address the fate of the more than 10,000 PLO guerrillas left in the northern port of Tripoli and the eastern Bekaa Valley. They are not covered by the Beirut arrangements.

Indicative of the maelstrom set in motion by the Israeli invasion and its consequences for the United States was an incident last month during U.S. Ambassador Robert Dillon's visit to southern Lebanon.

At one point a Haddad messenger suggested that the ambassador meet the renegade major. When the ambassador declined, his Lebanese host, Abdul Latif Zein, was arrested by Haddad's men and driven off in a jeep in which Israeli officers were riding.