CIA Director William H. Webster yesterday announced that he has picked Richard F. Stolz, a retired 31-year agency veteran, to return to the agency to run its clandestine activities as deputy director for operations (DDO).

One former top CIA official described the choice as a "brilliant appointment" that would help to restore the agency's credibility after the Iran-contra affair.

Stolz, 62, whose work has been in the clandestine operations, was in line to get the DDO job six years ago but balked and retired when then-CIA Director William J. Casey told him he would have to share the post with Max Hugel, according to a former colleague. Hugel, a businessman and political aide to Casey in the Reagan 1980 presidential campaign, was appointed to the job, but resigned two months later.

The DDO runs the CIA's spying activities that gather intelligence and its covert operations designed to influence policies abroad. Casey wanted Stolz to run the intelligence collection, while Hugel would run covert actions, sources said. Stolz refused and quit.

Stolz served in Moscow, but he was expelled in January 1965 in retaliation for the U.S. expulsion of a Soviet diplomat charged with spying in the United States.

Stolz also served in Sofia, Bulgaria, and Belgrade before becoming chief of the Soviet and then European divisions of the operations directorate.

Retired Adm. Stansfield Turner, CIA director under President Jimmy Carter, told the Associated Press yesterday that he almost gave Stolz the DDO job in 1977. "I narrowed it in late 1977 to John McMahon and Dick Stolz," he said in an interview. "I flipped a coin, and ended up giving Stolz an equally important job in the operations directorate that I can't talk about."

Stolz was chief CIA official in London where he handled liaison with British intelligence agencies before retiring, according to former colleagues. During the last six years, Stolz has been a "consultant to the national security community," a CIA spokesman said.

"Dick Stolz's strong background in the operations side of this agency eminently qualified him to fill this most important position," Webster said in his announcement.

Stolz will replace Clair E. George, also a 30-year CIA veteran, who was criticized in the recently released report of the congressional committees that investigated the Iran-contra affair.

In 1985 and 1986, when the CIA was prohibited from giving military assistance to the contra forces in Nicaragua, agency operatives working for George provided support.

Last month, George said he would retire at the end of this year.