After half a year's work, Walter Cronkite was putting the finishing touches on a probing, hour-long "CBS Reports" special on international terrorism when extremist Shiite Moslems hijacked TWA Flight 847, initially capturing more than 100 Americans and other passengers.

The CBS news machine went into action and the show is being updated with the latest facts woven throughout.

"This broadcast is about terrorism against Americans and why our government has found it so difficult to respond," Cronkite says in one update. Originally the show emphasized other forms of terrorism, mainly bombings, with one segment on hijacking.

"We could update right to the last minute or while it's on the air," says a CBS spokesman. "If news events warrant, Walter will come in and they could go on the air with live information." The show, "Terrorism: War in the Shadows," airs tonight at 10 on Channel 9.

The show's pre-hijack interview with Nabih Berri, a Shiite leader of the Amal movement, takes on special interest now that Berri has emerged as a key negotiator in the TWA hijacking.

In this interview, Berri complains that, after Israeli warplanes destroy Lebanese villages, "We don't hear from your U.S. policy one word . . . that 'we are sorry.' " Berri goes on to say that if someone then "kidnaps one American," that person is called a terrorist by the United States.

"Why do you look in the same eye two different ways?" Berri asks.

Even without the latest international outrage to point it up, the show was gripping enough. While it seems to conclude, as you might expect, that there isn't a lot we can do about terrorism, Cronkite manages in several newsy interviews with terrorism experts and top U.S. officials to make the point that the worst is probably yet to come -- major terrorism inside the United States itself.

Under Cronkite's familiar and, as always, avuncular coaxing, FBI Director William Webster discloses that there already exists within the United States "a sufficient apparatus" for Islamic terrorists to exact "some form of reprisal" in case this country does something in the Mideast to offend certain countries. It would be "entirely realistic" to expect such reprisal, says Webster.

While the FBI chief stops short of confirming that guerrilla fighters who might use such an "apparatus" are already in place within the United States, his revelation is fleshed out in an interview with Robert Kupperman of Georgetown University's Center for Strategic and International Studies. This expert describes the "infrastructure" of safe houses, weapons and documents that terrorists would need to do their work here, and adds chillingly:

"What's scary now for the first time in . . . the past few years is the development of that infrastructure. The capacity is here. Now, let me tell you, if we go attack some of these Mideast terrorist training camps, and I'm not saying don't do it, we may end up with trouble of this nature."

Cronkite presents the familiar vow by President Reagan about "swift and effective retribution," then goes on to show how difficult it can be to carry out that policy. The interviews, all fresh for this broadcast but done before the latest hijacking, demonstrate how divided top administration officials appear to be on this point. While Secretary of State George Shultz talks of "swift and sure measures" against terrorists, others seem more moderate.

"If we lose our cool, we may do things that we'll regret for a thousand years," says Webster. And Defense Secretary Caspar Weinberger says in measured tones, "It's very tempting, of course, to try to make a response by simply unloading a large bombing attack on some group you think may have done it, but that's not going to prevent it in the future."

The show has some interesting minutes on the massive security precautions that presumably helped prevent terrorism at the Los Angeles Olympics and on the antiterrorism squads fielded by various countries.

In the end, the show suggests there isn't a whole lot of hope. Former Deputy Under Secretary of State Lawrence Eagleburger says that while covert operations by the United States, including assassinations, may be desirable, "I don't happen to believe that the American people or the Congress are prepared to permit entities of the U.S. government to do that."

Kupperman ends it by saying, "We've got to decide ethically what we are willing to do . . . We've got to make decisions, because doing nothing is a decision that guarantees that we will be attacked repeatedly."