Eighteen states and the American Public Welfare Association went to court yesterday in an effort to stop the government plan to cut $831 million from Medicaid and welfare payments to the states.

The suit, filed here in U.S. District Court, asks that Health, Education and Welfare Secretary Joseph A. Califano Jr. be prevented from making the cuts, now scheduled to occur Sunday. Judge Harold H. Greene set a hearing on the suit for 1 p.m. today.

Yesterday's court action was just the latest in a series of moves in the confused and confusing flap over fraud, waste and abuse - and the $831 million.

In other developments:

NEW Undersecretary Hale Champion said he had asked Comptroller General Elmer B. Staats for an opinion on the legality of paying the $831 million from money appropriated for fiscal 1980.

The House, meanwhile, Wednesday night adopted a new amendment by Rep. Bob Michel (R-Ill.), directing HEW to cut $500 million more in waste, fraud and abuse from specified programs.

It was the first Michel amendment, passed by Congress last year, that sent sparks flying over the issue of mismanagement of social programs.

The amendment instructed HEW to pare $1 billion from programs where abuses had been identified - including Medicaid and welfare - during the current fiscal 1979 year.

HEW achieved $169 million of the cut in student loan programs. But last week, still $831 million short of the $1 billion order, it then decided to move against Medicaid and Aid to Familites with Dependent Chidlren.

States were notified that their shares of federal funds for the fiscal year's final quarter, which begins July 1, would be reduced by amounts corresponding to error rates found in their programs.

There were instant complaints from the states and members of Congress, who charged that Califano's move would penalize Medicaid and welfare beneficiaries who are legally entitled to payments.

Michel, among others, charged that HEW's last-minute action was an attempt to get around the directive to cut waste, fraud and abuse.

An additional complication arose from the language of this fiscal year's appropriation, which said that HEW could borrow from next year's money to make certain that eligible beneficiaries did not suffer cuts in their stipends.

The Senate on Tuesday adopted a nonbinding resolution, proposed by Sen. Roger W. Jepsen (R-Iowa), recommending that Califano borrow on next year's money to make certain the payments go through.

HEW, however, took the position - and apparently was supported in part by a Department of Justice opinion - that borrowing on next year's funds would violate the spirit of the Michel amendment.

Michel took another whack at Califano yesterday, saying his new amendment is intended "to make absolutely sure that Califano has no room to maneuver around the intent of the Congress."

The new amendment to the fiscal 1980 appropriation bill would, if agreed to by the Senate, require the secretary to cut a total of $1.5 billion in HEW programs during the two years.

Champion argued yesterday that Michel's amendments have "ignored the fact" of substantial savings already achieved through tighter management of HEW programs.

He said Michel's actions "make it appear that nothing is being done either by HEW or by the states, when both are working hard and making progress."

Champion said directives from Congress had put HEW in "a Catch 22 situation" - requiring cuts of $831 million, yet ordering no reduction of funds to which the states are entitled.

The HEW undersecretary said his agency plans to go ahead with its reduction of payments next week unless Congress or the General Accounting Office "clearly" authorizes release of the $831 million.