MANAGUA, NICARAGUA, DEC. 14 -- The Sandinista government, evidently concerned about the U.S. unveiling of a highly placed military defector, has launched a campaign to soften the impact here of his allegations and prevent Nicaragua's domestic opposition from exploiting them.

However, an effort to preempt the defector's disclosures seems to have backfired somewhat, President Daniel Ortega has been obliged to smooth over a militaristic hard line defiantly taken by his brother, Defense Minister Gen. Humberto Ortega.

A series of public statements by the two brothers over the weekend has underscored the more militant, outspoken and sometimes brutally candid nature of Gen. Ortega, as opposed to the more diplomatic approach of his brother, the president.

The statements also have highlighted a dilemma imposed on the Sandinista government by a Central American peace plan: a need to compete in a domestic public relations war with a recently reopened opposition newspaper and more active political parties.

In his latest remarks on the allegations of the military defector, Maj. Roger Miranda Bengoechea, President Ortega today denied that his government has a contingency plan, in the event of a U.S. invasion, to take Americans hostage and to spread the conflict to the rest of Central America.

"We have contingency plans . . . but they are not for attacking another country," Ortega said. "We are not talking of hostages, but of fighting American invaders." He added, however, that in a time of "great tension," it might be necessary to "evacuate American citizens" to safe places.

At stake in the Miranda disclosures, in the Sandinistas' view, are further U.S. congressional votes on aid to the Nicaraguan rebels, known as contras, and the future of the regional peace plan Nicaragua signed in August with its four Central American neighbors.

One loser in all this appears to be a farmer from Illinois, James J. Denby, whose small single-engine plane was shot down by the Sandinistas Dec. 6 over Nicaragua's Caribbean coast a few miles from the border with Costa Rica, where he owns a 700-acre ranch.

Authorities had said they would present him publicly last week, but have not yet done so. Now he appears to be caught in the cross fire over the defector, Miranda, a former close aide to Gen. Ortega.

In the wake of Miranda's allegations, Ortega indicated in a speech Saturday that authorities were seeking to link Denby with drug smuggling. Earlier, government officials had suggested that he was on some kind of reconnaissance flight for the contras.

Gen. Ortega's comments insinuating a connection between Denby and drug trafficking came after Miranda charged that senior Sandinista officials, including Ortega, cooperated with cocaine smugglers, allowing them to transit Nicaragua for a price.

In an effort to preempt Miranda's charges, Ortega on Saturday used information contained in questions submitted to him by The Washington Post and Time magazine to answer the defector's declarations to interviewers, without referring to Miranda by name, a Defense Ministry source said.

"What Gen. Ortega wanted was to denounce a CIA campaign, using Miranda as an instrument, to justify a vote for contra aid and undermine the Central American peace accord," the source said. "He wanted to prevent a campaign that is being renewed."

Ortega devoted much of the speech to an explanation of Sandinista military plans, which were contained in what Miranda identified as Soviet-Nicaraguan military cooperation protocols that he took with him when he defected Oct. 25. Comments by Sandinista officials have made clear that the documents are genuine, although the officials dispute the U.S. interpretation of them and insist, as one military source put it, that "they were not final."

"Our plans to arm the people in this historic stage have not yet concluded," Gen. Ortega said, in outlining plans for up to 600,000 Nicaraguans in a "defensive system" -- including reserves, militias and the regular Army -- and to acquire more modern weaponry.

The speech caused some alarm in Central America and Washington, however, and some Sandinista leaders apparently saw it as playing into the Reagan administration's hands.

In a press conference today, the president said his brother "has a specific task" as head of the armed forces and that, in addressing an assembly of labor union delegates, he was "obliged to exhort the workers in the defense of the country." He said Gen. Ortega's words were a "speech that is repeated all the time."

At the same time, however, both Ortega brothers have issued strong warnings to opposition parties.

President Ortega warned that the ruling Sandinista National Liberation Front (FSLN) would not allow the "so-called civic opposition" to become an "internal front" of the U.S.-backed contras.

And he made it clear that the party does not intend to give up the power it says it won for Nicaragua's working class in the July 1979 revolution against Anastasio Somoza.

President Ortega told about 600 Sandinista union delegates yesterday, "If the Sandinista Front is ready to give up power in the hypothetical case that it loses an election, what it would give up would be the government, but not the power." Ortega added, "In the hypothetical case that the people became deranged . . . and an opposition party were elected, this opposition party could govern as long as it respected the established power, and we will be ready to defend respect for this established power."

Questioned about these statements in today's news conference, Ortega denied that they reflected adversely on Nicaragua's commitment to the Central American peace accord, which calls for full political freedoms and free elections in the adhering countries.

Ortega said he meant that opposition parties were "obliged to respect the constitutional order."