The House Ways and Means Committee mailed its modified gas-guzzler tax into the energy bill yesterday after a two-hour wrangle during which it sounded as if most of tax was about to be thrown out.

Meanwhile, a House Commerce subcommittee completed action on all major non-tax parts of the plan, which President Carter hopes will have 4 1/2 million barrels of oil a day by 1985 and lessen dependence on foreign sources. This is how the non-tax provisions stood as they will go to the parent Commerce Committee next week:

Carter's major defeat was a 12-to-10 vote to remove price controls from new natural gas. He wanted to raise the price but keep controls. The issue is expected to be closely fought in both committee and the House.

The subcommittee approved a program forbidding all new utility and industrial plants to use oil or gas as boiler fuel and giving the government broad powers to force existing plants to convert from these searce fuels to abundant coal.

The subcommittee toughened a fuel-efficiency requirement for major home appliances, and went beyond the administration in requiring insulation before a home can be sold after 1982.

It voted to authorized funds to help insulate schools and hospitals and to require that ulitity rate structures be changed to forbid sale of electricity below cost. The coal-conversion and home-insulation programs would supplement tax provisions tentatively approved by the Ways and Means Committee.

The gas-guzzler tax to which the Ways and Means Committee gave final approval after nine separate votes yesterday would take effect on 1979 models. The tax on sale of a new car that gets less than 15 miles per gallon of gas that year would be $339. By 1985 models the tax on a new gas guzzler that got less than 23.5 miles would be $3,856.

The administration wanted to start the tax in the 1978 model year at 18 miles per gallon and go to 27.5 miles per gallon in 1985, with the maximum tax set at $2,488. Assistant Secretary of the Treasury Laurence Woodworth, the committee's former chief tax adviser, estimated that the committee version would save 170,00 barrels of oil a day by 1985, compared with 200,000 for the administrator's.

It appeared for a time yesterday as though the auto industry would succeed in watering down the gas-guzzler tax to practically nothing. On Thursday the committee had rejected a weakening amendment offered by Rep. William M. Brodhead (D-Mich.), who said he was only trying to exempt one Chrysler model - the New Yorker - from the tax for one year.

The committee had adjourned Thursday with an amendment pending to tighten miles-per-gallon standards. But the committee rejected that amendment yesterday. Then it voted 19 to 18 to reconsider the Brodhead amendment it had rejected, 22 to 14, the day before.

"if we approve this," said Rep. Joseph L. Fisher (D-Va.), "the headlines tomorrow will be 'Ways and Means Committee caves in to the auto lobby.'" He called the version the committee approved tentaively last week and finally yesterday "a modest step forward. Until we take that, we won't be taken very seriously on this whole subject."

Brodhead's amendment was amended twice by members attempting to strengthen it. Woodworth said this made the language "totally ambiguous." Staff members told the committee that Brodhead's amendment appeared to have been converted into a standby tax that would be triggered only when a company's entire fleet average miles per gallon fell below the standard.

Committee Chairman Al Ullman (D-Ore.) urged the committee to go back to its original position, which it finally did by a vote of 22 to 15.

"The deeper we go, the worse off we get," said Ullman.

Fisher proposed that revenue from the guzzler tax be earmarked for energy research, mass transit and state transportation programs. But several members who favored the principle said the proceeds - estimated at about $100 million a year - were so small as to be hardly worth the effort. It was rejected 11 to 3.

The administration proposals to rebate the money to taxpayers was rejected because it would mean only 50 cents per person a year. The commitee stayed with its original decision to use the revenue to retire a little piece of the national debt.

Meanwhile, Russell B. Long (D-La.), chairman of the Senate Finance Committee, predicted the Senate will pass a tougher gas-guzzler tax than Ways and Meand approved.

"I am somewhat confident that we cna do at least as much as the President recommended," Long said in an interview.

However, he said he is not sold on another part of the Carter energy-tax plan, which would rebate to virtually every adult an equal portion of money collected under a proposed new tax on crude oil.

"People will wonder just what is the idea of taking something from them and giving it back to them," Long said. He added it would make more sense to earmark the money for improving the nation's transportation system.