On the stage, Hubert Edwards, in pajamas and robe, was playing the role of a traumatized Vietnam veteran talking to his psychiatrist in a VA hospital when several members of the audience walked out.

"We were getting close. Too close. I was watching the audience when I could while the scene was going on," said actor Edwards. "They were going through what we were play-acting on the stage."

Last night was the first time that the Veterans Ensemble Theatre Company, a professional group with off-off Broadway credits, had performed the searing, powerful scene from Tom Cole's "Medal of Honor Rag" before an audience of hospitalized veterans. Most of the members of the audience at the Washington Veterans Hospital auditorium had served in Vietnam.

"We were just getting too close to what they're still going through," Edwards said after perhaps a score of members of the audience quietly left the auditorium as Edwards and Tim Elliot, playing a VA hospital psychiatrist, appeared in a scene from Cole's play. It was drawn from a real-life story of a Detroit Vietnam veteran who won the Congressional Medal of Honor and came home to die in a grocery-store holdup.

The scene from the "Medal of Honor Rag" was one act in a variety night of entertainment staged by the Veterans Ensemble for the patients. First came a magic show followed by some toe-tapping music from a fiddler, banjo player and folk-singer. Some of the veterans in the audience who had left during the play scene drifted back for the nightclub comedian who followed.

One who left and came back was a patient who was sitting in the front row. He was the one who answered Dave Fletcher, the slick magician with a steady patter, when he asked the audience: "Any one celebrating today? Somebody must be celebrating something."

"Another day of living," the vet offered and got a round for applause from his fellow patients.

All the male members of the Veterans Ensemble are Vietnam veterans themselves. Tom Bird, the director and founder, served with the First Cavalry Division in Vietnam. Jim Clark, who played the lead banjo with Fred Devyatkin as fiddler and Laura Copland as a stylish ballad singer, was a gunnery officer with a helicopter crew.

Bird formed the ensemble of veterans who also were professionals in the theater. With a grant from the National Endowment for the Arts, the group has been taking its variety show on the road to VA hospitals and recently has expanded its program for a follow-up visit that encourages the veterans to join in improvised routines for therapy.

At their off-off-Broadway theater, Bird said, the ensemble plans to stage two original plays by Vietnam veterans and a trilogy of classic war plays, including Rod Serling's "The Strike," for the 1980-81 season.