GENEVA, Switzerland (AP) _ U.N. mediator Diego Cordovez spent almost six hours shuttling between delegations from Pakistan and Afghanistan on Thursday as the fourth round of talks on resolving the Afghan conflict opened.

The negotiators are discussing a plan for the withdrawal of Soviet troops from Afghanistan, the repatriation of some 5 million Afghan refugees from Pakistan and Iran, and international guarantees for the security of Afghanistan and non-interference in its affairs.

Details of the negotiations were not released.

On Thursday, security guards blocked access to the second floor rooms of the United Nations office where the two delegations, who do not meet face to face, were waiting separately for Cordovez and his aides.

In the morning, Cordovez first met with Afghan representatives led by Foreign Minister Shah Mohammad Dost. Thirty minutes later, he went to the room of Pakistan's foreign minister, Sahabzada Yaqub Khan, and his team.

Neither minister spoke to reporters.

U.N. spokesman Roger Hans-Moevi said the talks were to continue Friday, and Cordovez said earlier they likely would end early next week. The first such talks were in 1982.

Cordovez declined to speculate on chances of a breakthrough. But said he was optimistic because since the last talks in August, unspecified ''procedural difficulties'' had been removed and there was a growing conviction on both sides that only a political solution could end the 51/2 years of Soviet occupation.

Before departing for Geneva, Yaqub Khan said he hoped there would be some progress, but he did not expect ''dramatic results.''

Soviet troops intervened in Afghanistan in December 1980, ousted one pro- Moscow regime and installed another headed by Presidet Babrak Karmal. An estimated 115,000 Soviet troops remain in the rugged, south Asian nation, helping Karmal's forces battle anti-Marxist Afghan rebels.

Pakistan and Afghanistan have refused to meet in direct talks. Pakistan says this would mean recognizing the Karmal regime as legitimte, and the Afghans have refused to meet the Pakistanis directly without such recognition.