Call it a bookkeeping transaction gone awry, but two House members from Louisiana pushed a provision through the House Interior Committee last week that would give the federal government $4.2 billion to reduce the deficit next year -- and add about twice that much in red ink over the next 30 years.

The vehicle was a bill designed to settle a long-running dispute between the federal government and seven coastal states over how offshore oil revenues should be shared. The battle, involving oil pools that lay under both state and federal waters, has gone on for more than seven years while the revenues built up in an escrow account.

When the House Budget Committee went looking for $55 billion to meet its deficit-reduction goal for 1986, the $5.8 billion account was a fiscal Lorelei.

Under pressure from Congress and the states, the Office of Management and Budget caved in last June, agreeing to give the states 27 percent of the accrued bonuses, rents and interest and abide by that split in the future. That was considerably more than the administration's last formal offer, which would have given the states 16 2/3 percent.

But the deal had an attractive sidelight. In addition to giving the states $1.5 billion, the settlement would produce $4.3 billion in "new receipts" for the federal treasury.

OMB officials said they agreed to the transaction even though the receipts represented "phony" savings. The money was already hard at work for the federal government, invested in treasury securities.

"We were using it all along," said one OMB official.

But when the dust cleared in the committee room, the agreement had taken on a new dimension. Over the objections of Chairman Morris K. Udall (D-Ariz.), the committee agreed, 22 to 17, to apply the same split to royalty payments and "other revenues," money the federal government had never agreed to share with the states.

The change was pushed by Democrats John B. Breaux and Thomas J. (Jerry) Huckaby of Louisiana, whose state stands to get about a third of the revenues. Texas and California are not far behind. Alabama, Alaska, Mississippi and Florida would get lesser amounts.

According to OMB estimates, the change will reduce federal revenues from offshore oil and gas production by up to $5 billion in the next 30 years. The Interior Department, eyeing the "other revenues" language of the change, said the figure could go twice that high.

"We fear that may mean tax receipts," said an Interior spokesman. "If so, the figure gets rather astronomical."

The Louisiana substitute includes a provision that would let the states "recoup" an uncertain amount of money that they contend the government failed to put in escrow.

"It's money that the government didn't properly account for," said an aide to Huckaby, who added that the coastal states think that the administration "reneged" on the original agreement by attempting to exclude some escrow funds.

OMB officials said that the administration intended to exclude about $500 million from the agreement, about $200 million of that in royalties and the rest in revenue from tracts that did not involve a shared oil pool.

Huckaby's aide agreed with OMB that royalties were not part of the original bargain. "The original agreement didn't address it," she said. "We just felt it ought to be settled once and for all legislatively."