Surgeons operated for about five hours last night to try to close an air leak that was causing serious pressure on the brain of White House press secretary James S. Brady, who was wounded in the March 30 assassination attempt on President Reagan.

At 1:10 a.m. today, Dr. Dennis O'Leary, George Washington University Hospital spokesman, said that Brady was in the recovery room and that there should be "no interruption" in his overall recovery.

However, O'Leary said, "I think we have to be a little more guarded as to the success of the repair." If the repair is not successful, Brady will have to under further surgery to avoid brain damage as a result of air pressure, O'Leary said.

He said that Brady was not in danger of death last night and that the operation was "non-urgent" and "not an emergency," although it would have had to have been scheduled soon.

The air leak developed as a result of an unclosed passage between the sinuses, or openings inside the head, and the brain. Brady became less responsive yesterday afternoon, and X-rays showed a significant amount of air in the ventricles, or inner canals of the brain, areas normally filled with fluid.

Two needles were placed through the top of the head into the ventricles to resolve the immediate difficulty, and Brady became normally responsive in short order, O'Leary said.

The mre elaborate and highly delicate surgery began at 7 p.m.

Neurosurgeon Arthur Kobrine soon found shattered bone involving the sinuses, with air communication from this area into the space between the brain and skull. The bone damage was along the bullet track caused by Brady's wound, and there was also a hole in the dura, the tough membrane covering the brain.

The damaged sinuses were packed with muscle tissue, and the hole in the dura was closed with a graft of muscle fiber. "At surgery," said a hospital statement, "the previous injury to the brain was observed to be healing well. . . . Mr. Brady has been very stable throughout the procedure."

O'Leary told reporters early this morning that Brady is "awake and wiggling his toes," presumably his right toes, since he still has recovered only a modest amount of voluntary movement on the entire left side of his body.

Brady was shot in the head in the attack outside the Washington Hilton Hotel. He was by far the most gravely hurt of four men, including Reagan, who were hit in the assassination attempt. The other two, a D.C. policeman and a Secret Service agent, have already left the hospital.

The tip of the left side of Brady's brain and 20 percent of the right side were shot away by one .22-caliber "Devastator" bullet designed to explode on impact. Doctors at George Washington University Hospital pronounced his injury a "very bad" one and said his prospects for recovery were highly uncertain.

Kobrine later said that eight or nine persons out of 10 with such an injury would have died almost immediately.

Doctors soon were calling the extent of Brady's recovery "almost miraculous," although Kobrine, his surgeon, continued to warn that his injury was massive and that "problems" could still occur.

Just this week, the White House said Brady would soon begin to walk with the aid of a cane although most of the left side of his body remains paralyzed.