Nearly four weeks after President Reagan unveiled his Middle East peace initiative, administration officials insist that the massacre in the Palestinian refugee camps of West Beirut has not derailed the plan but instead fortified Reagan's conviction that the United States must be the leader in trying to bring peace to the region.

With his initiative, Reagan departed from his previously hesitant approach to foreign policy to try his own version of the bold-stroke personal approach to the Middle East associated with Henry A. Kissinger and Jimmy Carter.

The initial impetus came from Israel's invasion of Lebanon. Then, in the midst of the crisis came Reagan's decision to drop Alexander M. Haig Jr. as secretary of state and replace him with George P. Shultz. Perhaps most important, in the view of many familiar with the process, was the interplay of these changes with Reagan's personality, instincts and personal sense of right and wrong, producing a fundamental change in the way he handled foreign policy.

Reagan, who had been largely content to let his subordinates map out details and then refer them to him for approval, become much more intimately involved in every phase of the new Middle East policy from its conception. Shultz, who acted as Reagan's architect, straw boss and tutor throughout the process, emerged as the undisputed captain of the administration's reshuffled policy-making team.

"I was determined to seize that moment," Reagan said Sept. 1 when he called for a freeze on Israeli settlements in the occupied West Bank and Gaza Strip, expanded negotiations to reach an interim autonomy accord for the 1.3 million Palestinian inhabitants of these territories, and eventual self-rule for the occupied lands "in association with Jordan."

At the core of U.S. thinking is a desire to move the Arab-Israeli conflict back to what administration officials call "a centrist frame of reference" between the Arab call to make the occupied territories an independent Palestinian state and the Begin government's long-range goal of eventually incorporating the territories into Israel.

The option proposed by Reagan -- peace based on a territorial compromise between Israel and Jordan -- is hardly a new idea in American diplomacy. Its outlines were first enunciated more than a decade ago by then-secretary of state William P. Rogers, and, over the years, an unbroken line of would-be U.S. peacemakers have come away from their Middle East experiences convinced that the so-called "Jordanian option" offers the only hope of breaking the impasse.

However, while the policy makers' views were well known to the Israelis and the Arabs, no U.S. government of recent years had followed Rogers' lead and offered them publicly as official policy. In fact, before Sept. 1, Reagan expressed only sketchy ideas on the Middle East and had been criticized heavily for failing to make a strong effort to revitalize the languishing talks between Egypt and Israel on autonomy for Palestinians in the Israeli-occupied territories.

Haig traveled to Cairo and Jerusalem in January and February to explore the possibilities of breathing new life into the autonomy talks. Finding both capitals preoccupied with the problem of returning the Sinai peninsula to Egypt, he postponed action until after the Sinai withdrawal in May, while beginning a policy review aimed at sparking a high-level resumption of the autonomy talks during July.

In charge of this review at the State Department were Richard Fairbanks, Haig's representative to the autonomy talks; Nicholas Veliotes, the assistant secretary for Mideast affairs; two of his deputies, Wat T. Cluverius and M. Charles Hill, and the policy planning staff headed by Paul Wolfowitz. All would continue to play key roles in the subsequent process, including the drafting of Reagan's Sept. 1 speech on national television.

Haig was left with the impression that any workable solution would require territorial adjustments to safeguard Israel's security and then associating the rest of the West Bank and Gaza with Jordan. However, according to officials familiar with his thinking, he also was convinced that if the United States made that goal public, it would only antagonize Israeli Prime Minister Menachem Begin and stiffen Israeli resistance to any movement on the occupied territories.

That is why, according to these officials, Haig criticized the Reagan initiative during recent remarks to a United Jewish Appeal meeting in New York. He expressed approval of the goal, but charged that Reagan's tactics would make Begin unwilling to cooperate.

Because of what one official calls Haig's "strongly protective attitude toward Begin," the policy review, as it unfolded under his direction last spring, was focused primarily on pushing the Egyptian-Israeli talks toward agreement on the outlines of a limited, five-year autonomy agreement as envisoned by the Camp David accords.

Then, in June, the administration's timetable was upset by Israel's strike into Lebanon and, shortly afterward, by Haig's resignation, which was precipitated in part by his advocacy of a tolerant line toward Israel while Defense Secretary Caspar W. Weinberger and national security affairs adviser William P. Clark were calling for tough measures against it.

The Lebanon invasion, which would lead to the breakup of the Palestine Liberation Organization's state-within-a-state status there, meant a radically changed Mideast political equation with the potential of some U.S. advantage.

But, while administration officials saw the opportunity to exploit the situation with some new initiative, they also found themselves under immediate pressure to do something to prevent irremediable damage to U.S. influence and credibility in an Arab world angry with Washington's failure to curb Israel.

It was at this point that Reagan made what a White House aide calls "an emotional commitment" to becoming involved. He was shocked by the bloodshed and destruction in Lebanon and angered by what he regarded as the duplicity and recalcitrance of the Israeli government, according to the aide.

In July, on the day before Shultz was confirmed by the Senate, Reagan summoned him to the White House and asked for a new direction for U.S. policy in the Middle East once the Beirut crisis was over.

Shultz directed the policy review team that he inherited from Haig to work with the Pentagon and the National Security Council staff to expand its sights beyond a mere resumption of the autonomy talks and to explore options for a more far-reaching approach.

He also reached beyond the bureaucracy to begin a broad process of consultation with former officials, Mideast experts, Congress and special interest groups such as the American Jewish community. The first of these involved a seminar-style discussion with Kissinger, former Du Pont chairman Irving S. Shapiro and former deputy attorney general Laurence Silberman. One participant recalled:

"I believe it was a seminal event in many respects. It exposed Shultz to a full airing of the Jordanian option idea, including the chances of its winning broad bipartisan support in Congress and even substantial backing from American Jews. Even more though, the session had the effect of stimulating Shultz intellectually. I think that by the time it was over he had sifted the problem down to the conclusion that we should go for something big enough to simultaneously tackle both Israel's security needs and redress for the Palestinians."

Other officials who worked with Shultz said the themes he encountered at that first meeting kept recurring throughout his subsequent consultations with other experts, with the Senate Foreign Relations Committee and the House Foreign Affairs Committee, and with key ambassadors who were recalled from the Middle East to discuss their views.

Most of the time, these officials added, Shultz let others do the talking and then went off to mull what he had heard. Periodically, he would turn up at the White House to give Reagan and Clark progress reports on the direction of his thinking, to answer their questions about different aspects of the situation and to kick ideas around.

All this activity was conducted under tight secrecy. Even many of the lower-level officials working on different aspects of the plan had only limited knowledge of what was afoot. Several of the outside experts and members of Congress with whom Shultz conferred later acknowledged they had no idea of what was coming.

Behind the secrecy was a desire to keep the Begin government from learning about the evolving plan.

As one U.S. official put it, "The minute Begin got wind of what was going on, he would have done his damndest to blow the whole thing up on the launching pad." As a result, while Israeli Defense Minister Ariel Sharon and Foreign Minister Yitzhak Shamir were both in Washington just days before Reagan's speech, they were given no inkling of the initiative in meetings with Shultz and Weinberger.

The officials conceded later that their success at keeping Begin in the dark helped to produce the acrimoniously defiant language subsequently used by Israel to reject the plan. But they denied that the secrecy was part of a strategy to force Begin out of power in favor of Israel's opposition Labor Party.

They acknowledged, however, their hope that Reagan's proposals will trigger a major debate that will make clear to the Israeli public the U.S. view that Begin is mismanaging relations with his country's most important ally and force a reassessment of his hard-line attitudes.

One notable exception to the secrecy effort was Jordan's King Hussein. Shultz sent Veliotes, a former ambassador to Jordan, to Amman in late August to sound out the king's reaction to the initiative.

Hussein, while noting that he would need a green light from the Arab world before becoming involved, said he would give the matter careful study. That was interpreted here as a sufficiently encouraging response to go ahead with a reasonably optimistic expectation of Jordan's eventual cooperation.

Following the Beirut massacre, Hussein called Begin "a master terrorist" and said he would not negotiate with the present Israeli government. However, U.S. officials claimed that his remarks leave room for him to change his mind, and they believe that his promise to consider the initiative and wait on developments is still valid.