Democrats aided by a handful of northern Republicans opposed to cuts in Medical and a few lesser programs denied one victory to President Reagan in the pandemonium last Friday night just before the House approved his version of the budget.

In a strategy decision a few minutes before the final vote, GOP leaders withdrew a budget amendment that would have "capped" future Medicaid growth and installed the president's proposals on medical block grants, family planning, energy subsidies and regulation and all other programs in the jursdiction of the House Energy and Commerce Committee.

As a result, language proposed by the Democrats, led by Energy and Commerce Chairman John D. Dingell (D-Mich.), remained in the budget bill. The administration Medicaid cap was not included, and family planning and a large number of other health programs were kept in separate "categorical" programs rather than being submerged in block grants, as the president sought. Some solar conservation programs were kept alive, as were the Public Utilities Regulatory Policy Act and a number of federally funded state energy conservation programs. The Dingell language on these programs, instead of the Reagan language, will now go to conference with the Senate, which on most issues did as the president asked.

The time was just after 6:30 p.m. Friday and the text of an amendment by James T. Broyhill (R-N.C.) putting the administration language into the bill in place of Dingell's had just been read.

Suddenly Broyhill took the floor and, to the astonishment of many members, asked that his amendment be withdrawn. And he promisd it would not be reoffered in any form by the Republicans that night.

He said that he was doing it because the hour was late, but actually, according to House GOP aides, the decision to drop the amendment came after GOP leaders and administration nosecounters had huddled and decided it would be tood risky to offer.

Reps. Bill Green (R-N.Y.), Claudine Schneider (R-R.I.) and several others had put together a loose coalition of an estimated 10 to 20 northwestern and midwestern Republicans unhappy with the proposal to limit Medicaid growth to 5 percent next year and other parts of the administration's health, energy and commerce proposals.

"The Medicaid cap would have meant very extensive cuts for the states involved," said Green in a telephone interview from his New York office yesterday. "We negotiated it up to 7 1/2 percent" with administration representatives, but Green said the group was still unhappy with the Medicaid situation or other commerce, energy and health proposals and most would have voted against Broyhill.

Moreover, Dingell several weeks before had corralled several southern Democrats by including in his package a provision allowing natural gas-burning utilities to keep using natural gas after 1990 instead of converting to coal. Republicans later offered a similar provision but Dingell had already nailed down the commitments.

GOP aides said the prospect of these defections made it "unclear whether we had the votes" to pass the Broyhill language. An acrimonious debate followed by a loss on the amendment could have derailed the president's victory express and possibly even endangered final approval of the entire bill, so GOP leaders decided to drop the amendment and go streight to the final vote. g

Republican and Democratic sources alike said the hottest lobbying came on Medicaid, on which a number of governors as well as hospital groups exerted pressure on delegations.

According to Dingell, both his version and Broyhill's would have cut about $5.9 billion in fiscal 1982 budget authority from health, energy and commerce programs.

The Dingell amendment proposed to cut Medicaid 3 percent in fiscal 1982, 2 percent in fiscal 1983 and 1 percent in 1984 from the amounts it was estimated states would otherwise get under present federal-state reimbursement formulas. This would mean a loss to the states of $1.1 billion over the next three years.

The president, by contrast, had proposed to cap federal Medicaid outlays at $16.4 billion in fiscal 1981, and limit the increase in this amount in 1982 to 5 percent (later 7 1/2 percent) and by the inflation rate thereafter. It would have cost the states considerably more in this program, which is the second-largest national health program and largest welfare program.

Both Dingell and Broyhill would retain the existing child immunization and venereal disease control programs as separate catagorical programs with cuts.

However, the Broyhill proposal would have united 24 other health programs into three block grants: maternal and child health, health services and preventive health, with the states given wide latitude to spend the money as they wish.

Dingell also proposed a maternal and child health block and a preventive health block, plus a separate alcohol and drug abuse block, but Republicans said too many federal strings were still attached to these blocks and they were really categoricals "disguised" as block grants to the states.

Moreover, Dingell's three blocks cover only 15 programs, and Dingell would continue a long list of other programs as categoricals, such as family planning, which is a particularly emotional issue for liberals and conservatives, mental health, and migrant health programs. Moreover, Broyhill would have killed health planning agencies, which seek to control hospital expansion; Dingell only cuts their money.

Broyhill would have converted the Consumer Product Safety Commission into a bureau in the Commerce Department, with its budget cut 25 percent and its legislative proposals subject to veto by the Office of Management and Budget; Dingell keeps it independent with slightly more money.

Among the survivors in last week's House budget brouhaha was the controversial National Aquarium, the nuch-abused fish zoo in the basement of the Department of Commerce building.

The aquarium was transferred from Interior Department jurisdiction to the Smithsonian Institution and given $400,000, of which $286,000 came out of Fish and Wildlife Service funds. The money is for maintenance at the aquarium's current site until the Smithsonian figures out how to work it in at the National Zoo in Northeast.

President Reagan had sought to eliminate the aquarium, which has been criticized as outmoded and too modest in size and scope to be a national facility.

Smithsonian spokesman Larry Taylor said the national zoo is planning on "aquatic habitat" exhibit, and the aquarium might become part of that.

"It will be a very interesting part of the zoo," he said.