For the last five years, 17-year-old Hee Ja Byan was a lone, mentally retarded, socially deprived girl who merely existed among 36 elderly women at St. Elizabeths Hospital.

She had been bounced through institutions across the country, and rejected by many, because of her unpredictable and violent behavior.

But yesterday, as the troubled girl's moods snapped back and forth, a D.C. Superior Court judge ordered the District government to send her to a West Virginia school for the retarded where, for the first time, she will receive personalized attention.

At St. Elizabeths, where she is called Lisa, the girl is totally unaware that the most important event in her life has just taken place.

Judge George H. Goodrich's order is the culmination of a four-year court battle to have her place in a more stimulating environment, one that might develop her best potential through the West Virginia institution's behavior modification program.

The order places Lisa's future in stark contrast to her start in life. She was abandoned on the streets of Pusan, Korea, when she was just five days old.

Nuns had found her on the streets and taken her to an orphanage run by the U.S. Catholic Committee for refugees. The agency brought Lisa to the United States, where she was to be adopted by an American family. When she was 4, the family discovered she was mentally retarded and halted the adoption.

Since then, Lisa has been moved frequently from one institution to another. She was committed to St. Elizabeths in June 1974, just hours after she stepped off a plane from New York City, where she was rejected by the Bellevue Mental Hospital because she was not a New York resident.

Under Goodrich's ruling, the city has been ordered to pay all costs of placing and maintaining Lisa in the West Virginia school, about 85 miles west of Washington, "until further order of the court."

Lisa's attorney, Harry J. Fulton of the Public Defender Service, said the cost of sending her to the school for the first year will be between $28,000 and $30,000, based on the institution's own estimates.

"In the court hearings, the director of Concore [the school] indicated that they would hire two additional staff persons during Lisa's first year to provide the necessary supervision," Fulton said.

After the first year, Fulton said the school hopes that by modifying Lisa's behavior patterns, she will be able to function with less supervision. By the third year at Concord, the city might have to pay only the school's regular tution of $12,000 a year.

"I don't think anybody sees this this youngster as ever being able to live independently," Fulton said. "But our greatest hope is that she will learn how to eat and dress herself and to interact successfully with other people."

"The experts agree that H.J.B. is both functionally and organically retarded," Goodrich said in his order. "While it is possible that her brain has suffered some damage, most of the retardation probably developed from deprivation of cultural and family influence.

"This environmental source for H.J.B.'s developmental deficits suggests that she could be trained, at least to some extent," the judge concluded.

At St Elizabeths, Lisa has been the youngest patient in a ward of elderly and generally senile women. While the authorities have realized that therapy might develop her mental abilities, treatment has been geared to regulating her psychotic behavior.

"St. Elizabeths is not equipped to respond to all of H.J.B.'s therapeutic needs," Dr. Leon Konchegul, Lisa's division director at the hospital, said in an April 3 statement to the court. "No satisfactory program could be created for her without isolating her from all other patients . . .

"This girl has been moved from place to place all of her life," Konchegul said yesterday as he watched Lisa play with a rubber band and a piece of cloth. "She has made some progress here. She counts to 10 now and can say some words . . .

"My only hope is that [at Concord] she'll be surrounded by people who will love her and be patient with her and accept her-as we have," he said.