President Reagan, in an effort to rescue his endangered Middle East peace plan, said yesterday that he is sending Secretary of State George P. Shultz to the region Sunday to obtain "the urgent and total withdrawal" of all foreign forces from Lebanon.

At a 14-minute White House news conference, Reagan expressed optimism that Shultz could succeed. Administration officials said afterward that the president was even more "upbeat" in his private conversations, a mood they said was based on conferences with U.S. officials about the progress of negotiations on the troop withdrawals.

"We are hopeful that an agreement between Lebanon and Israel can soon be concluded under terms which provide for the security of the borders," Reagan said at his news conference. "I must stress that until all foreign forces are out of Lebanon, that country cannot assert its sovereignty and begin real reconstruction."

Responding to a question about the unwillingness of the Palestine Liberation Organization to participate in Middle East peace negotiations, the president suggested that the process could go forward without the PLO.

". . . Maybe we're making the PLO more important than they are," Reagan said. "The negotiations don't have to hinge on the PLO being present."

Later in the news conference, the president was asked to confirm whether the White House had intelligence information that the PLO had been aiding the Sandinista government in Nicaragua and leftist guerrillas in El Salvador and that there were "some 50 PLO pilots down there."

"I can tell you that the report is true," Reagan replied. "They, like others in the communist states, have been there and are in there. And the episode with the Brazilian halting of the planes from Libya the other day--when the aspirin they were supposed to be carrying turned out to be hand grenades and things--is just further evidence of what we have said all the time, that there are outside forces, all of them principally aligned with and sympathetic to the communist bloc who are in there, and intervening in the legitimate affairs of those countries."

This is a theme some officials said the president is likely to return to next Wednesday when he addresses a joint session of Congress in an attempt to win approval of his embattled aid package for El Salvador.

Some administration officials yesterday linked the precarious state of U.S. foreign policy in the Middle East and Central America, plus the lack of progress in nuclear arms negotiations with the Soviet Union, in discussing the larger reasons for Shultz' trip to Egypt, Israel and Lebanon.

Increasingly, these officials acknowledged, Reagan's foreign policy is being described as near collapse, much as President Carter's was in 1979 before the Camp David Mideast accords. They said it was necessary for the administration to make some dramatic gestures for peace, one of which is involving Shultz directly in the Middle East negotiating process.

There has, however, been some resistance to the Shultz trip in the State Department bureaucracy, which takes a more pessimistic view of its chances for success than does the White House. Many officials said it was the bombing of the U.S. Embassy in Beirut last Monday that may have tipped the scales in favor of the Shultz trip.

Reagan said yesterday that "this latest crime" made his administration "more resolved than ever" to obtain an agreement that would lead to withdrawal of foreign forces from Lebanon.

He also brushed aside a statement attributed by a reporter to King Hussein of Jordan that the Middle East peace process "has just about collapsed."

". . . I've been in communication with him, both by phone and by cable, and that hasn't been the position he expressed to me," Reagan said of Hussein.

Shultz' trip is likely to take him to Cairo, Jerusalem and Beirut in that order, State Department officials said. He is expected to spend about two days at each stop, with the emphasis on obtaining a troop withdrawal agreement in Lebanon.

State Department officials said Shultz also will take soundings on the prospects for getting the president's Middle East peace initiative back on track and decide what to do on the basis of what he learns. These officials said the trip could end after a week, but that it is more likely that Shultz will go on to other Arab countries that could play influential roles in a Middle East settlement.

The additional countries Shultz may visit include Jordan, Syria, Saudi Arabia and, possibly, Morocco. The officials said it is also possible that Shultz will shuttle back to some of the countries he visits in the first week if this effort would contribute to an agreement on Lebanon.

In discussing the PLO yesterday, Reagan reiterated his determination to do something to help the "hundreds of thousands, millions, in fact, of Palestinians who aren't radicals and who simply want something of a homeland." A White House official said later that the president was using the word "homeland" in a general sense rather than talking about establishing a specific independent Palestinian state, which Israel opposes.

On another subject, Reagan was asked whether he would speak out publicly about alleged Soviet violations of strategic arms treaties. He acknowledged that it was difficult to obtain "courtroom evidence" of any violations, but said that past Soviet use of "loopholes" in treaties "imposes a responsibility on us to be more careful in a new treaty than we've been in the past."