CONDEMNED TO REPETITION The United States and Nicaragua By Robert A. Pastor Princeton University Press. 392 pp. $24.95

THE REAGAN administration's obsessive efforts to overthrow the Sandinista government in Nicaragua have always been rooted in the belief that the Nicaraguan revolution never had to happen in the first place.

In Reagan dogma, it is a given that Jimmy Carter, with his own obsessive concern over human rights, and his wimpish inability to identify and decisively quash threats to U.S. security, allowed Nicaragua to slip away into the Soviet camp. Some Reagan officials have suggested that U.S. interests would have best been served by active support of the Somoza dictatorship that the revolution displaced.

Did Carter "lose" Nicaragua, or worse, hand it over on a plate to the Sandinistas? Robert Pastor, who served throughout the Carter administration as Latin American director on the National Security Council staff, is in a better position than most to know. His answer is a qualified yes, but not in the way or for the reasons Reaganites think.

Condemned to Repetition is the first extensive insider's account of U.S. policymaking toward Nicaragua during the crucial four-year period that began in 1977, with the pro-American Somoza firmly in power, and ended on the eve of the Reagan inauguration, with Managua under incipient Marxist rule by an anti-American junta.

Neither Carter nor his national security adviser, Zbigniew Brzezinski, gave Nicaragua more than passing attention in their memoirs, a reflection of what Pastor demonstrates was their inattention to the subject during an administration dominated by domestic crises, Iran and foreign policy initiatives on the Middle East, China and arms control.

Most books on the revolution itself deal with it from a Nicaraguan perspective, giving the United States an offstage role as the colossus from the north whose usually negative shadow hung over the activities of the major local players. Condemned to Repetition suffers from the opposite problem -- a fixation with what was going on in Washington, giving short shrift to the fast-moving drama on the ground in Central America that theoretically was driving U.S. policy. But if the reader finds the Nicaraguan half of the story lacking, it is no less than the position from which the Carter administration operated, as it scrambled to make policy in a near total vacuum of accurate information or worthwhile analysis about the country it was dealing with.

In structure, the book compares U.S. policy toward similar situations, two decades apart, in Cuba and Nicaragua. Pastor argues that Carter performed little better and no worse, and not much differently, than his predecessors.

Revolution in both countries started after a prolonged period in which the United States was identified with an oppressive right-wing dictator, who was abruptly abandoned when the dictator lost domestic legitimacy and U.S. support became politically and morally untenable. In both cases, U.S. distancing from the dictator was followed by a frantic search for a moderate "third force" to take over before the left moved in. The search proved futile because political moderates had neither the strength nor the following to assume power. They doubted U.S. rejection of the dictator, and feared being tarred with the U.S. "imperialist" brush while the anti-American left clearly was ascending.

Assuming -- as Washington did in both cases -- that it was neither advisable nor possible to use U.S. force to keep out the left, the Americans were then obliged to deal with the victorious revolutionaries. Relations in both cases went through an initial period of negotiations and mutual suspicion that quickly became estrangement and ultimately turned into direct confrontation.

Thus, for all his high-minded principles of non-intervention and promotion of human rights, Carter ended up in much the same place as President Eisenhower -- greeting the Sandinista takeover with much the same lack of enthusiasm with which Ike welcomed Castro in 1959.

It was also the place where the Reagan administration began in Nicaragua. The only difference, Pastor says, is that Carter would have opted for an ongoing policy of containment and carrot-and-stick diplomacy toward the Sandinistas and would never have approved the U.S. organization and funding of the contras to overthrow them.

WHILE Condemned to Repetition begins in the late 1950s and ends in the present, its bulk, and its primary value, is a day-by-day accounting of what the Carter administration did as the Nicaraguan revolution unfolded.

Policy during the year leading up to the July 1979 Sandinista victory was made in a series of interagency committee meetings. As Pastor freely and sometimes painfully acknowledges, the meetings were either high-minded affairs, with consensus that Somoza must step down, or nitty-gritty discussions about who could be found to replace him before the guerrilla revolutionaries won. The trouble throughout was that events in Nicaragua were always several steps ahead, or moving in a different direction.

"Though the United States thought it had stepped into the role of arbiter, it had not," Pastore comments at one point during this process. "Decisions on the future government of Nicaragua were being made in Washington, but they were not being implemented anywhere."

A large part of the problem was the U.S. Embassy in Managua, a perennial foreign service backwater where there had never been any impetus for making contact with anybody but Somoza. Thus, the United States had no substantive knowledge of or inroads into the National Guard, the Somoza army the administration hoped to reform and use as the principle guarantor of a post-Somoza, non-Sandinista democracy.

"Most of those who attended the . . . meetings, including myself . . . assumed that a wide range of contact was maintained with Guard officers at all levels, and that plans were well-advanced to ensure the continuity of the Guard after Somoza," Pastor says. "The assumptions were totally false."

In its search for new, moderate leaders, the administration appeared unaware that, after more than 40 years of political deep freeze under Somoza, there was none with a following beyond the confines of the Managua business community. Although Nicaragua had a plethora of political groupings and associations opposed to Somoza, nearly all were what Latin Americans call "sofa parties" -- whose membership could all sit simultaneously on the same couch. By the time U.S. attention focused on these realities, the only anti-Somoza organization most Nicaraguans had ever heard of was the Sandinista National Liberation Front, and they were flocking to support its increasingly successful military efforts.

Meanwhile, U.S. friends in Latin America, whose hatred for Somoza outweighed their suspicions of the Sandinistas, were coordinating their efforts with Cuba and flooding the rebels with arms.

In one particularly telling scene, Pastor relates a high-level Washington meeting, attended by senior U.S. military personnel and then-CIA director Stansfield Turner, as well as senior National Security Council and State Department staff, called to discuss whether the United States should send F-4 interceptor jets to Panama to prevent an air strike against Somoza that had been threatened by Panamanian leader Omar Torrijos.

"The rather heated debate that ensued could have been avoided if anyone at the meeting had known that Panama did not have any fighters or bombers," Pastor notes.

Based in part on decisions by pre-Carter administrations, the United States had virtually no intelligence presence in Central America and had made a conscious decision neither to infiltrate nor even talk to the Sandinistas. "As late as one month before Somoza fled Nicaragua," Pastor says, "the United States thought a 'third force' could assume power because it was unaware that the Sandinistas had accumulated an arsenal and logistics network sufficient to defeat Somoza."

Pastor's point throughout is not that the Carter administration was particularly inept, but that its relations with Nicaragua reflected an historical pattern of mutual ignorance, inattention and suspicion between the United States and the Third World nations in its back yard that even the best of intentions could not overcome.

Far from inviting the Sandinistas in, Carter tried to use diplomacy to keep them out. Reagan tried to use force to throw them out. Both, according to Pastor, failed for the same reason. Their plots and plans did not take into account that Nicaraguans have been the principal players in their own drama. No amount of plotting in Washington can create political power where it does not exist, nor wipe out the legacy of history.

No one can say with certainty that, had Carter acted differently at any point, the Sandinistas would not be in power now, or that their government would be a free and democratic one. What can be said, Pastor argues, is that the Reagan administration is simply compounding the mistakes of its predecessors. By basing its assessment of cause and effect in Nicaragua on its own wishful view of how things are there, rather than on Nicaraguan reality, Reagan has helped Nicaragua move ever closer to the one thing it set out to avoid -- another Cuba.

Karen DeYoung, former Latin American correspondent for The Washington Post, now reports from its London bureau.