A Virginia circuit court judge has ruled that a controversial state law is designed to assist individual home buyers void house purchases and does not permit a Kentucky development company to cancel its contract to buy 31 acres of land in Stafford County and get its $200,000 deposit back.

The law permits a buyer to cancel an agreement to buy "residential real estate" if the contract does not state that the property must be delivered to the buyer within two years, unless other conditions are met. A Fairfax County couple used the little-known and long-ignored provision last summer to void a purchase contract for a home, stunning the building and real estate industries in the state.

But Stafford Circuit Judge James W. Haley Jr. said last week that the statute does not cover land that was unimproved at the time the contract was signed and that the Kentucky developer, Drees Co., "is not within the class for which the legislature sought protection" when it enacted the law in 1977.

Haley said the law was intended to shield individual buyers who put down money and signed contracts to purchase homes. Under the law, a contract that does not require the builder to turn over a house to the buyers within two years is not binding unless it is recorded in the court clerk's office and explained in writing to the buyer.

Drees officials are "disappointed" but have not decided whether to appeal the decision, said Victor F. Rinaldi, the company's attorney. Drees wanted to get out of the contract because of "various business and legal considerations," according to Rinaldi. The attorney said he could not be more specific.

The judge said Drees could not get back the $200,000 deposit it gave Glenwood Realty and Construction Co. of Garrisonville when Drees agreed to buy the Stafford land. Haley ruled that the contract between the two companies was void and that Glenwood is entitled to costs and attorneys fees.

Drees signed the contract in July 1989, agreeing to pay Glenwood $4 million for the property after Glenwood divided it into 88 lots and prepared them for house construction. Under the ruling, Drees will not have to pay the remaining $3.8 million on the contract.

Under the contract, Drees was to buy the property in segments, as Glenwood finished work needed to get each parcel ready for construction.

Last Oct. 10, two days before Drees was scheduled to pay for the first nine lots, the Kentucky developer told Glenwood it had decided to cancel the contract and wanted its deposit returned, according to the judge's decision.

When Glenwood refused to return the money, Drees's attorney wrote to Glenwood that he believed the notes securing the deposit were in default and wanted to sell the land to recover the $200,000. Haley halted the sale pending the court hearing.

Craig R. Johnson, vice president of Glenwood, said the judge's decision is significant because other companies are using the same law in attempts to "back out of contracts" signed a year or two ago before the real estate market's downturn.