The state of Maryland will go to court in an effort to force the return of $200,000 allegedly received in kickbacks by former vice president Spiro T. Agnew and former associates.

In the wake of a recent legal ruling, Maryland Attorney General Stephen H. Sachs said he has decided to reverse his previous position and try to join in a lawsuit now pending against Agnew and the others.

The suit, filed in 1976, contends that kickbacks discovered in the corruption probe that led to Agnew's resignation as vice president caused Maryland taxpayers to pay inflated prices for highway engineering contracts. The suit argues that the payments should be turned over to the state treasury. t

Sachs said last night that a recent ruling in the case indicates that the state may be a more effective plaintiff in the lawsuit than the three Montgomery County taxpayers in whose behalf it was filed.

Although both he and his predecessor as attorney general had declined invitations to enter the suit, Sachs said the new ruling by Anne Arundel County Circuit Court Judge Bruce C. Williams suggests it might be "irresponsible not to try" to join now.

Judge Williams ruled that the three taxpayers face the burden of proving "that the actions of the defendants have injured and specially damaged them" as individuals.

Sachs said that the state, which represents all the taxpayers, might be better able to show in court its special right to sue for the money.

"If, in fact, state contracts were given to persons who paid off," Sachs said, "the taxpayers of Maryland should get the benefit of the money paid."

Likening any payoffs to discounts on the contracts, the attorney general said that "if discounts are given, it is the people who should get the benefit."

Any such money should go to the state treasury, he added, and "we are the treasury."

A year ago, when he was first asked to join the case, Sachs said, he considered doing so but decided against it. At that time, he said, he believed that the state had nothing to add by entering and that by doing so might have seemed to be making a gesture "more theatrical than real."

However, he said, when David Scull, one of the taxpayers' lawyers, called him to point out the recent court ruling and renew the invitation, Sachs considered the matter again.

"Now that there seems there might be some practical difference (if the state enters) there seems reason to do it," Sachs said.

Sachs said that he reached his decision to join the case within the last week, and "within the next couple of weeks we will be asking for leave to intervene."

He cautioned that it is by no means certain that the state will be permitted to enter the case now. He said he expected a hearing on arguments on both sides.

The idea for the lawsuit stemmed from a class in legal activism given at George Washington University law school in 1973, the year in which Agnew, once governor of Maryland, resigned as vice president.

John MacMillan, a student in the activism class who now lives in Montgomery County, filed the suit with two other county residents in October 1976.

The legal costs of the suit have been borne by the Fund for Constitutional Government, a Washington-based public interest law foundation financed by liberal philanthropist Stewart Mott.