President Reagan yesterday condemned the bombing of the American embassy in Beirut as a "vicious . . . cowardly act," and he vowed that the heavy loss of life would not deter the United States from "doing what we know to be right" in the search for Mideast peace.

Reagan made that pledge as U.S. officials sought to assess the toll of dead and injured. At the same time, the officials made clear that the president has no intention of permitting the tragedy to affect his efforts to resolve the Lebanon crisis or the wider Arab-Israeli conflict.

In particular, they stressed, Reagan is determined not to let the terrorist attack force the withdrawal of the 1,200 U.S. Marines stationed in the Beirut area as part of the multinational peace-keeping force.

Some administration sources said the president now might find it necessary to underscore his continued commitment to his policies by making a dramatic gesture, such as sending Secretary of State George P. Shultz to the region.

They cautioned that no decisions have been made about a Shultz trip. But, the sources said, there is a growing feeling within the administration that the United States must signal clearly its determination not to allow Arab extremists to set the pace of events in the Middle East.

They insisted that Reagan intends to go forward despite renewed calls from some influential members of Congress to withdraw the Marines.

Sen. Barry M. Goldwater (R-Ariz.), normally a staunch supporter of Reagan's foreign policy, said, "I think it's high time we bring our Marines back."

Sen. Ernest F. Hollings (D-S.C.), who yesterday announced his presidential candidacy, warned that the United States must avoid "getting bogged down there" as it did in Vietnam.

However, Reagan, who made his statement at a Peace Corps ceremony, said he had spoken by telephone with Lebanese President Amin Gemayel and had assured him that "this criminal attack . . . will not deter us from our goals of peace in the region."

Reagan added that he had instructed his two special Mideast envoys, Philip C. Habib and Morris Draper, who are in Beirut, "to continue to press in negotiations for the earliest possible total withdrawal of all external forces" from Lebanon.

The U.S. goal in the prolonged talks is to win Israel's agreement to pull out its troops as part of a larger agreement that also would see the withdrawal of Syrian and Palestine Liberation Organization forces.

"The people of Lebanon must be given the chance to resume their efforts to lead a normal life free from violence, without the presence of unauthorized foreign forces on their soil," Reagan said, "and to this noble end, I rededicate the efforts of the United States."

Despite the congressional calls for withdrawing the Marines, the president also got some important support on Capitol Hill. Senate Majority Leader Howard H. Baker Jr. (R-Tenn.), who previously had expressed reservations about a U.S. military presence in Lebanon, said pulling the Marines out now "would send an unfortunate signal" to terrorists.

Sen. John G. Tower (R-Tex.), chairman of the Armed Service Committee, said, "I do not see this as deterring us from our effort to bring peace to the Middle East."

The bombing also intensified debate within the administation about whether Shultz should go to the region.

That has been under discussion since last week when the collapse of talks between Jordan's King Hussein and PLO leader Yasser Arafat dealt a potentially fatal blow to Reagan's Middle East initiative. Hussein and Arafat were discussing PLO approval for Hussein to enter peace talks with Israel.

Some top-level policymakers are known to believe that Shultz should try to revive the initiative through personal diplomacy with the region's leaders. However, Shultz and his top aides at the State Department have been wary of the idea because say they they believe there is little chance for success at this time and are concerned that failure would damage Shultz's credibility.

However, the embassy bombing, coming on the heels of the setback to the president's initiative, may have created a situation that one source described as "possibly tipping the balance toward a Shultz trip as a means of showing the flag in the face of an upsurge of extremism."

The sources said a decision won't be made until after Shultz returns tonight from a trip to Mexico City. The secretary issued a statement in Mexico expressing "shock and horror" over the bombing, adding: "Let us rededicate ourselves to the battle against terrorism . . . . It is long past time for peace and security to prevail."

Reagan said that Gemayel, in their phone conversation, expressed "profound regret and sorrow" at the bombing. The Lebanese ambassador, Khalil Itani, went to the State Department yesterday to publicly "condemn this brutal and cowardly attack."