The election of 1981 proved a lot less than it cost.

Taking comfort in a tiny and perhaps temporary margin, Republicans claimed a governorship in New Jersey to offset the one they lost in Virginia and then joined the Democrats and a host of other observers in reading more meaning into the returns than was evident to the naked eye.

New Jersey's latest unofficial but complete count yesterday gave Republican Thomas H. Kean, the former Assembly speaker, an 1,158-vote margin over his Democratic opponent for governor, Rep. James J. Florio.

The two agreed to wait until next week, when the vote is certified, to make any concession statements or victory boasts, and a state judge, acting at the request of outgoing Gov. Brendan T. Byrne (D), ordered state police to guard voting machines and absentee ballots in anticipation of a possible recount. Until then, Byrne said, he would give both candidates the state police protection accorded a governor-elect.

The unofficial tally gave Kean 1,142,174 votes to Florio's 1,141,016, a tiny margin, but four times the size of the lead the millionaire businessmen enjoyed over the four-term congressman before Essex County officials found a counting error late yesterday.

If the apparent Kean margin in the closest New Jersey election in a century survives the official canvass and likely recount, it would offset the loss Republicans suffered when their candidate for governor of Virginia, Attorney General J. Marshall Coleman, lost to Lt. Gov. Charles S. Robb (D).

The contests in the two states set records for spending--and for the negativism of the advertising barrages.

President Reagan campaigned for both Kean and Coleman, but the White House tried to minimize the president's personal stake in the outcome.

"We just don't characterize it as a referendum on the president's policies," said deputy press secretary Larry Speakes. "They were statewide races driven by state issues."

But Democratic Chairman Charles T. Manatt called Tuesday's voting "a serious political setback" for the president and contended that the results showed that "the Democrats are back on their feet." Manatt pointed not only to the top-of-the-ticket sweep in Virginia, where Democrats had been shut out for 16 years, but to the retention of Democratic control of the legislatures in New Jersey, Virginia and Kentucky and to the reelection of Democratic mayors in big cities from New York to Seattle.

"I feel much better than I did a year ago," Manatt said, noting that Tuesday's elections came on the anniversary of the Republicans' recapture of the White House and the Senate. "The grim reaper did not roll over the Democrats this year . . . .The coattail thing is relatively nonexistent."

Manatt's last point was endorsed by Republican National Chairman Richard Richards, who said that "the performance of the candidate was paramount" in such high-visibility and high-spending races as the two governorships. "Coattails and party labels" are probably more important in legislative races, he said, claiming that national party advertising and organization work helped the GOP pick up five seats in the New Jersey Assembly and eight in the Virginia House of Delegates.

Actually, the role of Reagan coattails and national party efforts was clouded in both states. Florio told reporters, "I underestimated the influence of the president," when he chose to focus the closing phase of his campaign on attacking Reagan's budget cuts.

But Republican strategists said they decided to pull the Reagan endorsement ad of Kean off the air in the final week--despite polls showing the president's 57 percent approval rating--because they wanted to concentrate on the more profitable theme of "time for a change" from two decades of almost unbroken Democratic rule in Trenton.

In Virginia, Republicans chose to saturate the airwaves with the Reagan endorsement of Coleman and--as Richards conceded yesterday--they believed on the basis of Reagan pollster Richard Wirthlin's nightly tracking surveys that the tactic was working well enough to avert what had seemed an almost certain Robb victory.

Richards said Robb prevailed because he "snuggled up to the president" and "was perceived as the conservative candidate." But he also received 97 percent of a heavy black turnout in the Richmond area--in part, Democrats said, because of fears that a Coleman victory would encourage political support in Washington for more Reagan budget cuts.

Richards said that Virginia carried a warning that "any Republican running in an area with a substantial black vote stands in jeopardy of being defeated by the black vote." He said Republicans "have to do a better job" of selling the Reagan program to blacks, but Manatt commented that "the more they explain their program, the more wise black citizens will understand it is not a program that will help them."

The continuing drama of the New Jersey contest overshadowed results from municipal elections across the country and a variety of issue referenda.

The list of reelected Democratic mayors included Edward Koch of New York City, Erastus Corning II of Albany, Coleman Young of Detroit, Richard Caliguiri of Pittsburgh, Donald Fraser of Minneapolis and Charles Royer of Seattle. Republicans celebrated the victories of two of their prominent incumbents, George Voinovich of Cleveland and Margaret Hance of Phoenix.

Among the newcomers were two blacks who were the first of their race to win the mayoralties of their cities, Thirman Milner of Hartford and James Chase of Spokane. Sheila Lodge became the first woman mayor of Santa Barbara.

Two major cities faced runoff campaigns. In Houston, where Mayor Jim McConn ran a poor third in his bid for reelection, City Controller Kathy Whitmire emerged as the favorite over Harris County Sheriff Jack Heard in the Nov. 17 runoff. Whitmire received 36 percent of the vote and Heard polled 25 percent.

In Miami next Tuesday, four-term Mayor Maurice Ferre, a native of Puerto Rico, will meet Cuba-born Manolo Reboso, a Bay of Pigs brigade veteran. Ferre had a tiny lead in Tuesday's first round of voting, with minor candidates splitting a quarter of the vote.

Nuclear power issues did not fare well in Tuesday's referenda. Austin voters overwhelmingly decided to end participation in the South Texas Nuclear Project, ending nine years of controversy. Washington state voters approved public votes on future financing of nuclear power construction, a move that was strongly opposed by the nuclear industry.

Kentucky voters rejected Democratic Gov. John Y. Brown Jr.'s effort to amend the constitution to allow himself and other state officials to seek reelection. West Virginia voters turned down a $750 million road bond issue that was the project of Gov. John D. (Jay) Rockefeller IV (D).

Ohio voters rejected a "nonpartisan" reapportionment process, strongly backed by business and the GOP, that would have ended the Democrats' current control of the pending congressional redistricting. Ohioans also turned down a business-backed measure to allow private companies to sell unemployment insurance in the state.

San Diego County residents approved a ban on public employe strikes, Palo Alto, Calif., voters turned down a homosexual rights ordinance, and Detroit voters rejected an advisory referendum on casino gambling endorsed by Mayor Young. Columbia, Mo., became the first city requiring mandatory deposits on all bottles and cans. Six states have similar laws.