The director of an Alexandria-based anticommunist organization, bowing to a grand jury subpoena, flew to Los Angeles yesterday with thousands of computerized documents that California prosecutors say may contain confidential Los Angeles police files on alleged subversives.

Linda Guell, executive director of Western Goals Foundation, agreed to comply with the subpoena, her attorneys said, after renegotiating an understanding with Los Angeles authorities that she will be granted immunity from possible prosecution. An earlier immunity agreement had fallen through, the lawyers said.

In a related development, the Court of Special Appeals in Maryland blocked, at least temporarily, a subpoena against a second Western Goals official, John Rees, Baltimore-based editor of the foundation's newsletter.

Rees, an accredited journalist and Washington correspondent for various John Birch Society publications, has invoked the so-called reporter's "shield law" in Maryland that he says protects him from having to disclose news sources or materials. That and other issues will be argued before the appellate court on Oct. 7.

Meanwhile, it was learned, the documents sought by the Los Angeles grand jury, including data stored on 60 to 70 computer "floppy discs," were transferred from Rees to Guell, who took them with her to Los Angeles.

Attorneys for Rees say the documents are all "public domain" materials--newspaper clippings, handbills, interview summaries with public officials--and contain no confidential Los Angeles Police Department files. Attorneys for Guell say they are not certain about the documents and thus, as a precaution, asked for immunity for Guell.

The grand jury is looking into allegations that Los Angeles Police Detective Jay S. Paul funneled secret police dossiers and other materials on political extremists into a Western Goals computer.

Paul, a veteran member of the police department's now disbanded Public Disorder Intelligence Division, signed a $30,000-a-year contract with Western Goals to program a Western Goals computer in his wife's Long Beach, Calif., law office and enter data in it relating to antinuclear protests, terrorism and other subjects.

Prosecutors acknowledge that much of the material is "public domain" but contend some also originated from police files. Dissemination of such material outside the police department is a violation of California law.

Western Goals is a privately funded research and publishing organization founded in 1979 by Larry McDonald, the archconservative Democratic congressman from Georgia who was killed Sept. 1 when Soviet fighters downed Korean Air Lines Flight 007 near Japan.