James Tolbert, 38, had been a popular and successful account manager for the Consumers United Insurance Co. He played Santa Claus at Christmas and cooked for the company picnic. Then, his problems with cocaine took over. A heavy user, he was arrested on Aug. 5, 1983, after police, who had made an undercover purchase from him, raided his apartment and found a stash.

For months, Tolbert's lawyers lobbied with prosecutors trying to avoid a mandatory sentence of 20 months to five years in prison. In the end, they were lucky to get a judge who went to extraordinary lengths and then some to accommodate the plea bargain.

The amount of cocaine police seized in Tolbert's Adams-Morgan apartment was sizable by Superior Court standards: 56 grams worth $5,600. And, Tolbert had a prior drug conviction. Attorneys Plato Cacheris and Larry Gondelman tried several ploys to minimize the damage.

First they asked that the charge be reduced to simple possession. No go, said prosecutors. Then they tried to get the case transferred to U.S. District Court, where the mandatory sentencing law doesn't apply. Okay, the prosecutors said, but only if Tolbert would testify about his supplier. He balked.

Tolbert then agreed to plead guilty to felony drug distribution in the hope of being placed in a treatment program instead of prison. Prosecutors, in turn, agreed not to contest his claim that he was selling drugs to support his cocaine habit, Gondelman said.

But when the case came before Superior Court Judge Ricardo M. Urbina, the plea bargain fell apart. Urbina ruled that cocaine didn't qualify for the exemption in the law that allows addicts to get drug treatment instead of prison time.

Urbina allowed Tolbert to withdraw his guilty plea. The case was transferred to Senior Judge Joseph M.F. Ryan and Cacheris and Gondelman went back to their law books and found yet another gambit.

Cocaine isn't considered a narcotic under the mandatory sentencing law, but it is defined as a narcotic in an obscure city statute that requires the mayor to start civil commitment proceedings against addicts who need treatment.

Ryan wrestled with the issue, but in the end found an out of his own after consulting with the court's sentencing and prison specialist, William Erhardt. Under the federal Narcotic Addict Rehabilitation Act, Erhardt told the judge, Tolbert could be sentenced to an indeterminate term of treatment within the federal prison system, even if the drug to which he was addicted was cocaine.

Ryan, who was never very eager to send Tolbert to prison in the first place, sentenced him to federal drug treatment -- a move that in effect granted him the addict exemption. "I thought I weaseled a way out," the judge said. "Here's somebody who could be a productive citizen, who could be paying taxes like you and me . . . . I don't think we should just toss people on the trash heap. "

Tolbert was released after serving 11 months in treatment at the Federal Correctional Institute in Lexington, Ky. He now waits tables at a restaurant in Georgetown.

Attorney Gondelman still seethes over the final outcome. He thinks Tolbert should not have gone to prison.

"With all due respect to the District of Columbia electorate, they don't know what they're doing when they pass a statute like this," he said. "They just think they're putting more people behind bars."