The staccato burst of the FBI tommy gun, which terrorized gangsters in the 1930s and is still the grand finale of the popular tour of FBI headquarters here, has come up against an enemy it can't defeat: the Occupational Safety and Health Administration.

The problem isn't the .45 cal. bullets the submachine gun sprays around, but the smoke and fumes and lead particles that fill the air of the firing range during the shooting exhibition.

It seems the ventilation system is inadequate to meet OSHA's health standards for air movement and lead pollution. So early next year, the gunfire will be silenced for three months while a $185,000 repair job is undertaken in the $126-million FBI building.

Though a color movie of live firing at the training center at Quantico will be substituted, the officials who run the tours - which attract more than half a million people a year - are concerned about even the temporary loss of such a main attraction.

"It does make a nice finish for the tour," said Gordon E. Malmfeldt, head of the section which runs the tours. "The kids especially seem to like it."

Yesterday, traditionally the busiest day of the year for tourists, an estimated 6,000 persons stood in long lines for the chance to take the one-hour trip through the glories of FBI history. Past the 10 "most wanted" posters nd modern computer gear and J. Edgar Hoover's desk, the visitors found their way at last to the firing range.

There, protected by a glass partition, the audience watched an FBI agent pumps shots, first from a .38 cal. handgun and then the Thorpson submachine gun, into human ssilhouettes on a paper target. Children pressed close and oohed and ahhed as backlighting emphasized the tightly packed pattern of holes in the middle of the target.

The ventilation problem was apparent to the FBI shortly after the move into the new J. Edgar Hoover Building in the late 1975.

"It was obvious as soon as we first test fired and people started coughing and gasping and wheezing that the smoke just didn't clear out well enough," said Jack Tykal, another FBI official involved with the tours.

In December, 1975, the bureau sent a letter of complaint to its landlord, the General Services Administration. And after minor adjustments failed, an elaborate redesign program was started.

Walter Huber, of GSA, recalls "the problen was simply that the ventilation system was designed years ago before OSHA ever even existed. It just doesn't meet the new standards."

A $15,000 architect's fee and a $170,488 construction contract later, the problem is on the way to being solved, Huber said. Larger blowers and filters will recirculate the smoky air and, after a Jan. 23 to Apr. 24 period of silence, the chatter of the tommy gun will be heard again.

And regular after-hours target practice for FBI headquarters and Washington field office agents, which Tykal says has been "drastically curtailed" because of the smoke problem, will be resumed.

Ironically, the FBI doesn't include the tommy gun in its active arsenal any more. The more accurate civilian version of the Army's M-16 is the bureau's current automatic weapon.

But the tommy gun is still featured in the tour. Tykal said, because "it's the traditional automatic weapon of FBI history. It may only be a romantic anachronism, but we think people want it and expect it. It's far more a showman's weapon."