The next time Congress decides to play legislative stud poker with other people's money it would be well advised to avoid using the paychecks of workers in Uncle Sam's two most militant agencies - Labor and HEW - as chips.

We came close to having a very ugly mess here next week.

Thanks to an 11th hour decision to defrost the Labor-HEW payroll, Congress managed to avert an almost certain ugly confrontation Tuesday with thousands of federal workers, and maybe even a series of troublesome wildcat strikes by Washington's normally docile federal force.

What happened was that Congress - for 13 days this month - refused to approve the Labor-HEW money bill because of conflicting language over federal funding or abortions.

Although the abortion issue had nothing to do with the competence of performance of Labor-HEW employees - 43,000 of them here - the Senate House roadblock cut off authority to pay them for work performed after Oct. 1. That meant that the checks Labor people are due Monday, and HEW people will get Tuesday, would have been for only one week's work, instead of the two week pay due them.

When it looked as if the House wouldn't vote a continuing resolution (permitting the payout to take place while the disagreement continued) Labor and HEW employees began to get unhappy. The ideal of getting half pay - particularly through no fault of your own - doesn't appeal to many people.

As it happens, Congress couldn't have picked two worse agencies to tread on while it fought out a complicated, but unrelated issue. Labor and HEW workers are battle-scarred veterans of protests, usually other people's. But they are not averse to fighting for themselves, too.

Union membership is high in both departments.And membership participation is deeper than in many federal agency unions, and super-militancy at the top, especially at Labor, is standard.

Union members in both agencies have both taken active role in the old Vietnam war protests and other social issues. Labor Department union members have never been short of issues, happily spending time, talent money to protest bus company hiring, and labor disputes of newspapers, candy companies, wine producers and boycotting lettuce and grapes picked by the wrong people.

"Those things were important to us," a union leader said, "but a lot of it was distant and abstract, almost a proxy protest (which he conceded is sometimes the most confortable.) But this was us! Can you imagine how our people would have reacted if the ax had fallen on them, and they had to go home with half pay for something they didn't understand. There would have been some hell raised here Tuesday, you can bet on that."

There were plans for a march on Capitol Hill Tuesday, demonstrations all over town and talk of slowdowns or sickouts by many Labor and HEW employees here. (By contrast, Agency for International Development workers, also faced with the prospect of half pay next week, went about their business as usual. Only two called this newspaper to protest the situation, whereas hundreds of Labor and HEW workers protested by telephone or letter).

An AID official said "maybe our people are jaded by this kind of thing. It seems to happen to us all the time." He said he could recall only one instance, about 10 years ago, when AID workers took temporary pay cuts because of a budget mess. "But every year, it seems, we have the threat of payless paydays. Nobody seems too upset."

Congress has been dangling the threat of no-pay, or half pay, in front of AID for years without any big problems. Bit probably won't try that stunt again with Labor and HEW.