While Carter administration officials agonized last year over how to reorganize the federal bureaucracy, 20 state legislatures passed "sunset" laws to provide for the periodic review of state agencies and programs, and the automatic termination of those judged not up to snuff.

While members of Congress debated last year over how to encourage citizens to save energy, 21 state legislatures approved new bills or improved existing laws to promote consumer energy conservation.

And while administration officials fumbled last year with what they called a "national urban policy," at least three states -- Massachusetts, Michigan and California -- were winning plaudits for plans and initiatives to aid what some federal officials have grown fond of calling "distressed cities."

In short, state legislatures, long the butt of jokes about governmental incompetence and corruption, have become "more professional" and have begun to take the lead in handling problems traditionally left to the federal government, according to surveys of 1977 state legislative activity by state government associations and the congressionally financed Advisory Commission on Intergovernmental Relations (ACIR).

The new professionalism means that state assembles are writing "more comprehensive laws, tighter laws," said John Callahan, state-federal relations director of the Denver-based National Conference of State Legislatures.

In the past, you had legislatures writing laws that were very general, that left a lot up to the discretion of the executive branch and the regulators."

The new laws are clearer, tighter and leave less latitude in enforcement, thus making them more difficult to circumvent, he said.

Also, Callahan said the new professionalism has produced another phenomenon in state lawmaking:

"It used to be that only five or six legislators knew the issues and dictated the voting on bills," he said. "But that kind of thing doesn't go any more. More legislators are becoming more expert on certain subjects, which means that more are participating in the lawmaking," he said.

Callahan said another force contributing to activist legislatures writing detailed laws is activity by pressure groups. The various special-interest groups are demanding that their legislatures do more and be more accountable, he said.

"The new mode is to write more comprehensive legislation, more detailed laws -- which also causes some problems," he said.

For example, he noted that some states have written environmental laws that place tighter restriction on industry than do federal standards, causing outcries from business.

Some state advocates claim that state lawmakers frequently have been a step ahead of their federal counterparts. It's just that the news media are now beginning to take notice, they say.

"The states have always been in the forefront of passing far-reaching legislation before Congress has ever gotten to it," said Paul Albright, a spokesman for the Council of State Governments in Lexington, Ky.

For example, on matters involving strip-mining legislation, no-fault automobile insurance and health cost containment, the states have played a leading role, he said.

Still, he said, activism on the part of state legislatures "seems to have exploded somewhat" in recent years.

The Washington-based ACIR, which monitors federal-state relations and makes recommendations for improvements, agrees. In a draft of its report on 1977 state legislative activity, ACIR said: "The [state] legislature's ability to make policy has been enhanced by the expansion of its professional staff. Almost all states now have a legislative council or its equivalent to provide research facilities and policy analysis."

However, that does not mean all state assemblies have lost their knack for trumpeting so-called "easy" issues, according to an ACIR spokesman.

The spokesman said some state legislatures "lost time on substantive" issues last year by debating whether to legalize Laetrile -- a drug derived from apricot pits and used by some to treat cancer -- and working on bills to out-law child pornography.

"In a number of cases, it was a 'pits and porn year," the spokesman said. 'The time spent on these issues could have been spent on other things like fiscal matters and home rule," said the spokesman.

NCSL's Callahan disagreed. At least 17 states last year passed laws banning child pornography -- mostly by tacking the anti-pornography bills to existing child abuse statutes.

Callahan said the child pornography legislation came about "because many lawmakers hadn't realized the extent to which child pornography existed --at least, not until all of the publicity on the subject." Other state assemblies simply realized they had no laws on the books outlawing child pornography, he said.

According to the NCSL survey, "The area of greatest activity in the states during 1977 was human resources, particularly new laws to aid the elderly and the abused wife and child."

Several states -- including California, Oregon and Iowa -- developed home health care programs for the elderly, about 40 states considered "right to die" legislation, divorce laws were eased in several states and 11 passed laws legalizing Laetrile, according to the survey.

ACIR named the trend toward "sunset" laws as one of the major state legislative activities last year. The commission characterized the trend as a "dramatic . . . development in state legislative oversight," but noted that at least one state -- Alabama -- may run into problems as a result of the legislation.

The Alabama law would terminate more than 200 state agencies this year unless they are re-established after review. The problem is that the legislature does not have time to review all of the agencies. "The Alabama law currently is being re-examined," ACIR said.