The U.N. Security Council yesterday moved toward approving a resolution that threatens future economic sanctions against South Africa, but gives Pretoria more time to indicate that it intends to grant independence to Namibia.

The resolution averts a Security Council confrontation between black African advocates of sanctions and the United States and its allies, who have been seeking time to attempt to preserve their crumbling plan for a peaceful Namibian solution.

After two weeks of private negotiations and public rhetoric here, advocates of early and full Namibian independence from South Africa introduced a resolution that warned that economic sanctions would be a possible next resort for the Security Council if South Africa does not keep its promise to allow U.N. supervision of Namibian elections next year.

U.S. and other Western sources said the five Western nations that have been trying to arrange a peaceful solution would abstain when the resolution comes to a vote. The vote is likely to be Monday.

U.S. Ambassador Donald McHenry said the United States was unhappy with some aspects of the resolution but that he expects it will be approved.

The resolution introduced by Gabon, India, Kuwait and Nigeria condemns South Africa's plan for elections on Dec. 4 in Namibia that would exclude the Southwest Africa peoples Organization (SWAPO), which has been leading guerrila warfare against South Africa control of the territory.

It calls for cancellation of these elections and for elections under U.N. auspices. Failure to comply, the resolution says, would compel the Security Council to consider imposing sanctions. This hypothetical mention of sanctions apparently was the reason that the United States and its Western allies plan to abstain rather than vote yes.

U.N. Secretary General Kurt Waldheim is asked to report back to the Security Council by Nov 25. on South African compliance with the resloution's demands.

Although South Africa has been given deadlines before and let them pass without major consequence, several diplomats said they thought it was useful to clarify the present situation by giving South Africa a little more time.

"Some people think South Africa is playing games" one source said. "Now we will see for certain"

The present round of U.N. negotations on Namibia was triggered three weeks ago when Secretary of State Cyrus Vance and ministers from Britain, France, West Germany and Canada visited Pretoria to urge South African compliance with the plan for elections under U.N. supevision next spring.

The South African response was confusing Vance and others returned saying that South Africa had not closed the door to such elections, but South Africa also made clear it was going ahead with the unsupervised elections next month.

African leaders were angered by what they branded as new proof of South African duplicity. They also expresseds suspicion that the Carter administration, which had led efforts to find a peaceful Namibian solution, was altering its Africa policy was reverting to the approach of previous administration that had been friendlier towards South Africa.

The United States and Western Europe has investment of about $20 billion in South Africa.

In the past, the United States and European nations have voted black African-led attempts to impose sanctions on the South Africa.

Namibia, formerly called Southwest Africa, was placed under South African administration in 1920 by a League of Nations mandate.

If Waldheim cannot report significant South Africa moves toward compliance with the Security Council's demands, the problem of unraveling the old mandate will arise here again, with African nations likely to press for sanctions similar to those the United Nations imposed against Rhodesia.