SUDDENLY, THE CODE WORDS are given and the nocturnal tranquility of the desert is shattered by the staccato sound of automatic arms fire and jarring explosions. In minutes, a small commando group has successfully completed its mission - storming the buildings, killing the terrorists and rescuing the hostages.

This exercise, a routine one, took place several months ago at a secret location in the West. The men who carried it out were members of the Army's elite Delta Force, an antiterrorist commando unit that stands ready to fight it out against real terrorists, at any time or place, to save Americans held hostage.

The secrecy-shrouded 250-man Delta Force is part of a $1 billion-plus military counterterrorist effort mounted by the United States in 1981, in the wake of the disastrous mission to rescue the hostages in Iran. American commando teams are now considered to be just behind the Israelis and on a par with the British and West Germans in capability. They have dazzling high-tech weapons, massive computer banks filled with intelligence data and a global spy network at their disposal.

Yet other than for training exercises like the one in the desert, they may never get the chance to use them. For, despite the effort and money that have been spent on these finely honed forces, they face logistical, bureaucratic and political obstacles that have repeatedly kept them out of action, and may insure that they never actually carry out their primary mission - rescuing hostages. The commandos have been thwarted by breakdowns of aircraft meant to carry them into target areas; by a bureaucratic system that requires them to rely on another military unit for intelligence; by a lack of response from the White House at key times; by interference from other agencies, and, ironically, from high-ranking military officers in the Pentagon whose mistrust of small, elite forces is deep-seated.

''Our capability to launch a long-range, Iran-type mission today is worse than it was in 1980,'' says Noel C. Koch, who was Deputy Assistant Secretary of Defense in charge of the Pentagon's special operations and counterterrorist units from 1981 to 1986.

Koch, now a private security consultant, is sitting in his office in a (Continued on Page 78) rundown, two-story Arlington, Va., building overlooking an industrial zone near National Airport. It is filled with mementos from special units and troops all over the world. Koch was known in the Pentagon for his outspoken criticism of the military brass's unwillingness to take the counterterrorist units seriously. Asked about the future of those forces, he says flatly, ''I don't think we will ever use them.''

For many commandos, the cumulative frustration has taken a personal toll, prompting dozens of officers to leave the counterterrorist units in recent years. Marine Lieut. Col. William V. Cowan is a former senior officer in the Army's supersecret Intelligence Support Activity, which gathers intelligence for commandos. When he joined in 1983, after 17 years in the Marines, Cowan turned down a far more lucrative and prestigious job on the White House Science Advisory Council. But two years later, he resigned, tired, he says, of the ''bureaucratic mismanagement of the counterterrorism program.''

Soft-spoken and cautious, the 45-year-old Cowan does not fit the stereotype of a secret warrior. After leaving the military, he joined the staff of New Hampshire Senator Warren B. Rudman, the ranking Republican on the Senate committee that investigated the Iran-contra affair, and helped probe the activities of a fellow Marine, Lieut. Col. Oliver L. North. He was repelled by North's unauthorized operations and believes in strong Congressional oversight for covert operations. Still very active in the counterterrorism debate within the armed forces, Cowan has refrained from speaking out publicly.

But now, he says, ''We simply don't have political or military leaders who really understand the nuances of counterterrorism.''

AMERICAN COUNTERTER-rorist units have not been totally inactive. In 1982, they provided technical assistance to the Italian carabinieri in the rescue of Brig. Gen. James L. Dozier, who had been kidnapped by members of the Italian Red Brigades. Immediately after the bombing of the Marine barracks in Beirut in October 1983, an American commando team tracked down those who had ordered the attack. However, although the commandos devised several ways of striking back at the terrorists, no order for retaliation came from the White House.