A man who won a chance to buy a low-priced Bethesda townhouse in a Montgomery County lottery last March, only to have his winning declared invalid a week later, will now get his opportunity to buy the house.

Montgomery County Circuit Court Judge Stanley B. Frosh last week reversed the county government's March decision to give the first right to purchase the townhouse to the Housing Opportunities Commission (HOC), a county agency that finds housing for lower-income people, instead of to lottery winner Johann K. Englehart. Frosh ordered that Engle-hart be given first choice to buy the $35,490 three-bedroom townhouse.

The much-publicized lottery was Montgomery's way of deciding who would get a chance to buy the 12 moderately priced units that 600 people signed up to buy. The houses - part of Bethesda Court, a new development near Montgomery Mall - were created through a 1974 county law that requires 15 percent of the units in new developments of 50 or more units be set aside as moderately priced housing. The units are priced by the county Office of Housing and offered only to people whose incomes match a county government-determined scale of moderate incomes. The law was an attempt to provide low-cost housing in one of the nation's counties.

In Bethesda Court, the moderate-priced units sold for no more than $35,490 while other houses in the development, with essentially the same floor plans, were selling for $69,000 to $88,000.

County officials had believed that their moderate dwelling units law gave HOC 60 days to decide whether or not to purchase a third of the low-priced houses. HOC did not decide until after the lottery to buy the houses. However, since the decision fell within the 60-day period, four people were bumped from the winning list of the lottery, and one of the four, Englehart, sued.

In his decision, Frosh said the county's allowance of 60 days for HOC to decide on the moderately priced units was actually not in the law. Frosh said, in his decision, that the law does give HOC an option "to purchase or lease up to one-third of all the moderately priced dwelling units in a particular housing project." But the guidelines for tha process "were never adopted as agency regulations," Frosh wrote.

In addition, the participants in the lottery were not given sufficient notice that they "could lose the fruits of the lottery process," the decision said.

"Had the exact terms of the county's option to HOC been made precisely known to each participant at the lottery a different result might ensue, the judge wrote in his decision.

"The whole case turned around on the 60-day provision," said Donald Hoage, the county attorney who represented the Office of Housing in the suit. "The county had no basis for giving HOC 60 days to decide whether or not they wanted to purchase the houses."

According to HOC lawyer Paul McGuckian, the 60-day option may have been inadvertently left out of the moderate dwelling unit law when it was last amended. "That has surprised us," he said, about the judge's finding. "The law had been amended and the part the county ammended had brackets around it. The typist typed to the end of the brackets but left out the rest of the section with the 60-day part. I believe the council already has taken steps to amend the law again and put the option back in."

"I think it's unfortunate the (60-day time period) was inadvertently ommitted," said HOC director Bernard Tetrault. "We're disappointed we won't be serving a lower-income family or . . . some on public assistance."

HOC allots its share of the moderately priced dwelling units to people on a lower income scale - the scale used for special federal housing programs like Section 8 - than the scale used by the Office of Housing.

County Executive James P. Gleason said the county would not appeal the decision.

Tetrault said the entire incident with the lottery and the HOC was "one of those misunderstandings."

The other three lottery winners who lost their chances to buy houses did not sue. Their houses have now been bought by HOC clients, said Tetrault, unlike Englehart's, which could not be sold until a court decision was reached. Hoage said the other, lottery winners could attempt to sue, but the decision of Frosh only pertained to the Englehart case. Anyone else who spes might get a different decision, he said. Suits over the sale of the other three houses "would be a real hassle, Tetrault said.