The Soviet Union, in an apparent attempt to turn the diplomatic tables on the United States, is demanding that the Reagan administration and other Western governments pass domestic legislation and accept creation of a U.N.-flagged naval force to ensure that any new Security Council resolution imposing an arms embargo on Iran will have "teeth."

Soviet diplomats have told Iraq and other Arab governments that they are ready to support a new U.N. resolution that would punish Iran for its refusal to accept a cease-fire in the Iran-Iraq war, according to Arab diplomatic sources here and in the Middle East.

But they also have implied that their support for such a punitive resolution against Iran depends on the United States and other Western governments agreeing to establish a U.N. naval force in which the Soviet Union would have a role, the sources said.

In addition, they have told Arab governments they want Western nations to enact laws aimed at preventing secret shipment of arms to Iran, as the United States did in 1985-86 as part of the Iran-contra affair and as other disclosures indicate various West European governments or companies also have been doing.

"They want a boycott with teeth," said one Arab diplomat here. "They don't want to be dragged into opposition to Iran without a real embargo. They are saying, 'Have you forgotten Irangate?' "

The Soviets have told the Iraqis that they have in mind a U.N. naval force that could blockade Iranian ports, search ships bound for Iran and seize arms found aboard them, Washington Post correspondent Patrick E. Tyler reported from Cairo.

The Soviets also have been telling Arab governments that they delayed agreeing to discuss a U.N. arms embargo because they wanted one with effective enforcement measures.

Arab diplomats in the region said they believe the Soviet position would represent a diplomatic coup for Moscow at the United Nations and embarrass the United States and Western European nations, which are likely to balk at setting up a U.N.-flagged naval force, Tyler said.

The new Soviet stand seems to have the potential for putting the Reagan administration on the defensive after months of criticizing the Soviet Union for "shielding" Tehran and seeking to enhance its position there at Western expense by refusing to discuss a U.N. arms embargo against Iran.

Administration officials have opposed creation of a U.N.-flagged naval unit in the Persian Gulf because they say such a force is unprecedented, likely to prove unworkable and would legitimize the Soviet presence in the gulf.

"The idea of putting together a general U.N. naval force is one which we think would simply divert attention," Undersecretary of State Michael H. Armacost told Washington-based foreign correspondents Friday in a briefing on the results of the summit.

Arab sources said the Soviet demands could be a new ploy to further stall the U.N. Security Council, whose permanent members are the United States, the Soviet Union, China, France and Britain, from taking any action against Iran because it would take months for the United States and other governments to enact laws to penalize companies and individuals caught selling arms to Iran.

On the other hand, the same sources said that the Soviets could have a "legitimate suspicion" in the wake of the Iran-contra affair that Western nations, or companies, would continue to sell arms to Iran while the Soviet Union and its allies stopped.

Assistant Secretary of State Richard W. Murphy told a Middle East Institute conference here Friday that East-bloc nations still account for 15 percent of arms sales to Iran, while arms sales by Western nations have fallen dramatically. Only four Western nations were detected selling arms to Iran in the first six months of this year, and the total value was less than $200 million. In 1984, 23 sold more than $1 billion worth.

China has now become Iran's major arms supplier, accounting for between 60 and 75 percent of the total this year, according to administration and congressional sources.

One Arab source said it appeared the Soviets wanted an agreement first on the measures, but the United States wanted the Security Council to first pass an embargo resolution.

But the same source said later he thought the Soviets were "thinking out loud, raising these questions to see whether they {the Americans} are willing to go along with these measures in advance."