"I told you I would untangle this," said Mayor Marion Barry yesterday after his announcement of a shake-up in the D.C. Department of Employment Services.

But the mayor's action, in accepting the resignation of two top department officials and disciplining nine other workers, follows three months of cautious deliberation and damage control. Other serious problems that Barry has been slow to resolve during his seven-year tenure came to a head in the last 10 days, creating an uneasy atmosphere less than six months before he faces election.

Some of the mayor's critics say he has been too slow in solving problems of prison crowding, alleged corruption in city government and hazardous or rundown conditions in the schools and public housing.

"Procrastination has become the code word of his administration," said D.C. City Council member John A. Wilson (D-Ward 2), one of three council members thought to be considering a challenge to Barry. The others are Chairman David A. Clarke and member Charlene Drew Jarvis (D-Ward 4).

The convergence of events was vividly illustrated last Friday at the District Building

Deputy Mayor Alphonse Hill was hustling down the steps of the east exit to escape reporters demanding to know whether he would resign because he had accepted payments from a city contractor.

Deputy Mayor Thomas Downs, in the middle of negotiations with the White House to end a hunger strike by homeless activist Mitch Snyder, was patching together a plan to bus 55 overflow jail inmates to Pennsylvania, a move that by night's end triggered a confrontation with Pennsylvania Gov. Richard L. Thornburgh.

Herbert O. Reid Sr., the mayor's legal counsel, was huddled with other Barry advisers under pressure to resolve the fate of employment services officials ensnared in the scandal that sent former deputy mayor Ivanhoe Donaldson to federal prison seven weeks ago.

The mayor was standing in front of a battery of TV cameras, explaining why he couldn't put any more money in the fiscal 1987 budget for city schools despite the demands of 44,200 residents whose petition signatures had been dumped on his desk that afternoon.

The climactic events that day were "aggravating and agonizing," according to Downs, who has become the mayor's top administrative troubleshooter.

"The mayor is down," calculated Jarvis, "but not out."

Barry aides and supporters insist that critics are exaggerating some of the mayor's difficulties because it is an election year. "This is to be expected," said Dwight S. Cropp, director of the office of intergovernmental relations. "The same types of things happened in 1982."

One Barry adviser suggested, however, that recent developments may force the mayor to mobilize his campaign workers earlier than expected in his anticipated bid for a third term. Barry, who said he has raised over $200,000, has indicated he will announce his reelection plans in late April or early May, but he could activate a vigorous behind-the-scenes campaign before then.

"If anything, recent events may cause him to gear up the campaign a little earlier than planned," the adviser said.

Others around the mayor said they were concerned that Barry may be suffering from the loss of some of his most able political and government advisers.

Donaldson, the former deputy mayor for economic development and for years Barry's top political adviser and administrative whip, began serving a seven-year prison term in January after he pleaded guilty to federal fraud and cover-up charges. Elijah B. Rogers, who was Barry's high-energy city administrator during the mayor's first term, is now an accounting firm executive who still is seen frequently at the District Building but who is out of the day-to-day operation of the government.

One council member observed that the loss of Donaldson and Rogers means Barry is less insulated from politically perilous situations. "You have to recognize that Barry has a long record of these battles," the council member said. "This is a mayor that has learned a lot, but he still can use some help."

Barry rejects the idea that his political flanks were left unprotected with the departure of several trusted comrades.

"I have both the ability and the skill to overcome these situations," Barry said at his monthly press conference yesterday. " . . . Anytime you are born black and poor in Mississippi and you overcome that adversity, you can overcome almost anything."

But even as he parries the press and critics, Barry occasionally betrays his own doubts. Last Sunday, following a press conference in which he said he had accepted Hill's resignation as deputy mayor for finance, Barry closed by joking that he was on his way to church: "To pray -- for myself."

Divine intervention in the morass of city problems does not appear quite as likely as federal intervention, however.

Early last week, U.S. Department of Housing and Urban Development Secretary Samuel R. Pierce Jr. disclosed that one of his top aides would take a direct hand in managing the District's troubled public housing system. Maintenance delays and other problems identified in a 1984 HUD audit have gone unresolved, according to federal officials justifying the intervention.

Local and federal courts have the mayor pinned on prisons policy as well. Under court order to limit the D.C. Jail population, Barry has not made the tough decision of where to build the new prison he says he supports. The crowding problem has become so severe that two weeks ago Barry was forced to propose placing offenders in a renovated police station on Ninth Street NE in Ward 6.

That notion prompted City Council member Nadine P. Winter (D-Ward 6) and angry community residents to hold an old-fashioned sit-in protest in Barry's office suite last Monday. Earlier, council member William Spaulding (D-Ward 5), who, like Winter, is up for reelection, also reacted with outrage to a separate Barry proposal to consider a prison site in his ward.

Barry's underlying prison strategy, suggested a council member, has been thwarted by the unexpected action of U.S. District Judge William B. Bryant, who imposed the jail population limit last summer, and by Federal Bureau of Prisons officials, who stopped taking D.C. prisoners Jan. 15.

"I think it has always been Barry's hope to put off the decision of where to put the prison until after the election," the council member said. "But the court intervened and forced his hand."

On the schools issue, Barry appears more comfortable, relying on a base of support built when he served as school board president.

Nevertheless, at precisely the time Winter was occupying the mayor's suite, a massive demonstration outside the District Building was being staged by 3,000 parents, teachers and students who wanted the mayor to support an increase of $16 million in school funding.

Barry said the money wasn't available, but potential rivals for the mayor's seat, including Clarke, Wilson and Jarvis, scurried to prove him wrong and win political points.

Yet to be gauged with certainty is the political fallout from the federal investigations of Donaldson and Hill.

The mayor and Reid, under pressure from critics, worked feverishly to resolve the problems in the employment services department. But even as they were doing so, Hill acknowledged, in an unrelated case under investigation by a federal grand jury, that he had taken payments from the head of an accounting firm that does business with the city.