The Maryland Attorney General's office yesterday filed suit against retired district court judge Richard V. Waldron of Prince George's Country, charging that he was violating state law by practicing as an attorney while collecting a state retirement pension.

Maryland law forbids former judges on judicial pensions from practicing law for compensation.

In its suit, the attorney general's office seeks to enjoin Waldron from practicing law and to recover some $10,000 in pension benefits the state estimates he has received since opening his law office in Riverdale several months ago.

Waldron, 62, who was appointed to the county district court in 1967 by then-Gov. Spiro T. Agnew, said in an interview yesterdy that he wouldd continue to practice law despite the attorney general's action.

"It is still my considered opinion," Waldron said, "that the law is unconstitutional and unenforceable."

Waldron originally tried to get the law declared unconstitutional in his own lawsuit last year.

A circuit court judge ruled in his favor, saying the statute violated Waldron's constitutional right to practice law.

The Maryland Court of Appeals later overruled that decision but failed to decide the issue of constitutionality. It dismissed the case, saying Waldron sued the wrong party -- the state retirement board -- instead of the state attorney general or bar officials. The law was left intact.

Waldron, who claims to have spent $10,000 in attorney's fees and court costs, decided against filing another suit.

"I've poured too much money into it," he said at the time, "I'll just let them come after me."

Maryland Assistant Attorney General Alfred L. Scanlan, Jr. said yesterday that the state wants the issue resolved.

"It is a central question of the state's power . . . There are a number of other retired judges or soon-to-be retired judges who may want practice law," he said.

The attorney general's office acted after a Washington Post article reported that Waldron had opened his practice at 6132 Baltimore Boulevard, and had sent out announcements of his new law practice identifying himself as a former judge.

The statute in question says that a judge "who retires and accepts (a pension) may not, thereafter, engage in the practice of law for compensation." There is no criminal penalty for breaking the law, but injunctions may be sought against violators.

The attorney general's suit also asked that the Maryland law be declared "valid and constitutional in all respects."

According to state estimates, if the Maryland law is overturned, more than $200,000 in retirement benefits might have to be paid to retired judges currently practicing law, who are not collecting their pensions.

Scanlan said he is confident that the case will be heard fairly, even though it potentially "strikes at [all the judges'] pocketbooks."

Privately, sources say it would be surprising if a judge ruled against Waldron's position that he should be permitted to collect his pension and practice law for compensation. "If he wins, I can [do it too]," one judge said.

Waldron, who had a reputation as a gruff, no-nonsense jurist, served as a judge until 1977, when his term expired and a judicial nominating commission failed to recommend his reappointment. CAPTION: Picture, RICHARD V. WALDRON . . . says law is "unconstitutional"