In the pandemonium that reigned on the House floor Friday night, a handwritten note was enacted into law that, for the time being at least, levels the National Science Foundation and obliterates research funds for three other federal agencies.

A few words scrawled at the top of a page in President Reagan's substitute budget proposal left science agencies gasping, congressmen arguing from the floor against a move that might inadvertently kill U.S. scientific research, and congressional staffers scratching their heads i in wonder.

The scrawled note, read aloud by the House clerk, called for striking a portion of the budget proposal to insert different material. What was deleted was NSF's budget, as well as the research budgets of the Department of Energy, the Environmental Protection Agency, the National Oceanic and Atmospheric Administration and the Federal Emergency Management Agency. The substitute material contained a revised budget only for the Department of Energy.

That left NSF and three research budgets as clippings on the floor. At first congressmen and agency officials were assured that the deletion was a mistake that would be corrected by a quick technical amendment, said Patricia Nicely, head of the congressional liaison office for the NSF.

But when the smoke had cleared and no fix had appeared, it became clear that while the deletion did inadvertently wipe out a couple of small business programs, dropping the science agencies was no accident. It was a Republican maneuver to strip these budgets out of the large budget package.

The science budgets were not actually killed by the action Friday, but they now must come up as separate bills before the Congress. That makes them far more vulnerable than when they were safely tucked into the recesses of the big budget bill, especially in the hatchet-wielding mood Congress has exhibited recently.

"Clearly, it's a way the minority can use to bring the full pressure to bear for the NSF bill they want," said Thomas Moss, staff director of a House science and technology subcommittee. "There is no doubt that the budgets of these agencies are now in very severe jeopardy."

Gerald Jenks, staff director of the House Science and Technology Committee, acknowledged that the science budgets were cut for political reasons. "There is $127 million in the National Science Foundation budget above the Reagan request," he said. "We wanted a chance to make an amendment to that." That kind of consideration isn't possible when the budgets are included in a bigger bill.

Jenks said he was surprised that the "Democrats made such a big deal of it," and so was James Hedlund, minority staff director of the House Budget Committee.

"We really didn't think about it very much, and frankly if we had known all the furor it would cause, we might not have done it," said Hedlund, who speculated that the whole budget package may have lost votes over the wrangle.

He said there were other slips during the week, for example when the second half of the energy research budget was dropped Wednesday because it looked too much like the first.

But Hedlund said the science budget maneuver, although intentional, was "innocent" of politics -- it was simply that the Republicans did not want to clutter up the main budget reconciliation package with bills that they thought should be considered on their own.

Staffers from both the minority and the majority said that the original maneuver of putting the science budgets into the big package was intended to protect the budget from attack, and that this last-minute action was a countermaneuver that seemed to get out of hand.

Rep. Leon Panetta (D-Calif.) said the deletion waqs noticed by another congressman and brought to the attention of the Republicans presenting the budget package. He said they called it an "obvious mistake" that would be fixed later. Only late yesterday afternoon did Panetta discover that the maneuver was intentioanl, at least in part, and that it stood.

He said there may be some technical problems with bringing up budget bills after their deadlines have expired, and rules may have to be waived to get the bills to the floor for consideration.

"It's an incredible way to do business," he said. "I was just looking at this package and it's full of scrawling and writing and it's just a mess."