The Soviet Union continued its bitter media attack against the failed Iranian hostage rescue mission today with comments that suggested that Moscow is pressing its goals of isolating the United States in the Middle East and improving its own chances for strategic gain in the Iranian turmoil.

Pravada, the Communist Party daily newspaper, declared that the U.S. operation showed President Carter's Iranian policy to be one of "military provocations, threats, political and economic blackmail." Commentator Genady vassiliev asserted that the U.S. actions "carry a grave threat to peace and well-being" in the Middle East.

The Soviets have shown a great uneasiness with the Islamic fundamentalist regime of Ayatolloh Ruhollah Khomeini, but have moved to try to establish better ties.

Last summer when factional fighting flared among Iranian ethnic minorities, the Soviets began hinting that they backed autonomy demands of the Kurds and Azerbaijanis. And in September, in a commentary widely noted in the West, senior Izvesstia analyst Alexander Bovin declared that religious fanaticism had driven the country to economic chaos, primitivism and political repression.

But after the Americans were taken hostage Nov. 4, the Soviets grasped the opportunity to side with the Iranians. a senior party official asserted that the leadership could see no reason for or advantage to aiding the United States in extricating the hostages, and the Soviets in January vetoed a U.N. Security Council resolution demanding sanctions against Iran.

While the two countries failed last month to reach agreement on new prices for Iranian natural gas crucial to Soviet trans-Caucasian industry and population, Moscow has continued such aid projects as expansion of the Isfahan steel complex and electric power generation stations.

Middle-level party members in private conversations this week professed confusion over the U.S.-West European economic sanctions program, "If you and your allies cut off trade, Khomeini has only one place to go," one veteran journalist asserted -- "north to us. U.S. policy is a mystery."

Blockade-running trade over the long Iranian-Soviet border or across the Caspian Sea seemssure to carry political gains for Moscow. Khomeini has bitterly assailed the Soviet invasion of Afghanistan as war on Moslems, and the Soviets would like to see themselves in a position to try to staunch such criticism.

The opportunity for taking a direct hand in running Iran's oilfields in the absence of Western technology and personnel also is seen here as a tempting target for Moscow.

In recent weeks, the Soviets have floated various hints that they are interested in exploring new forms of anti-Western solidarity with the Arab and oil-producing Middle Eastern nations. They have suggested that Arab oil revenues could be withdrawn from Western banks, and have sided with Saudi Arabia in its dispute with Britain and other European nations over showing a controversial film about the execution of an adulterous Saudi princess.

Yesterday, the offical Tass news agency hinted that European and Japanese participation in economic moves against Iran could trigger a "counter-embargo in support of Iran" by independent oil-producing states, which analysts here interpreted to mean the Persian Gulf region.

The commentary pointed out as well that the Soviet Union is an important energy supplier for West Europe, and declared that "the present turn made by the White House toward cold war and economic blackmail against the Soviet Union and the socialist community creates a serious threat to Western Europe and Japan for convenient external energy sources."

The Soviets last year earned more than $6 billion in hard currency from their oil exports, helping them to sharply reduce their hard-currency debt despite major purchases of U.S. grain. Higher world oil prices have made energy exports the most important single component of Soviet hard-currency trade. Analysts here said any hints of a possible energy embargo by the Soviets must be weighed against the importance of this trade.