Daniel Ortega, the president of Nicaragua, knows he is a terrible trial for people in the United States who have gone bail for him.

"Looked at coldly," he says of his latest public relations bomb, his imposition of a state of emergency on his poor, battered country just before his arrival at the United Nations, "there is no logical explanation of the timing or the context."

The "logical explanation" being given by the gleefully outraged right-wing is that Ortega has stood up and unmasked himself as Ronald Reagan's "Loony-Tunes dictator."

In an early morning interview last week, Ortega said philosophically that it was like the last time, when, days after Congress canceled all aid to the contras, he set off for Moscow.

"When I did that, it was a bucket of cold water," he said, as his wife, the vivacious poetess Rosario Murillo, passed tortillas and poured coffee in the couple's U.N. Plaza Hotel suite.

"I had to go to Moscow because it was a matter of life or death for Nicaragua. We had no oil."

When he was deliberating about depriving Nicaraguans of freedom of the press and other perquisites of democracy, he said, "We took into account what Congress is doing. But they are not stopping the war."

Ortega has been bombarded with public relations advice and, at least about clothes, he has accepted. He was wearing a dark blue blazer and gray flannel slacks. New York's Mayor Edward I. Koch, praised him for his mufti at a U.N. reception: "You look more peaceful," he said.

The forced military bluster has been modified. He looked boyish, and was focused and earnest.

His handlers thought he had shown he "is no Marxist monster" during his New York stay. He decisively broke out of the U.N. pack by being the only head of state to jog five miles in Central Park. He was on national television shaking hands with Reagan. He and Rosario made a sympathetic appearance on the Phil Donahue show, as a beleaguered Third World Yuppie couple.

But no one told him that the leader of a dirt-poor country should not throw his money around, and he spent $3,500 on eyeglass frames at a New York optical store. He wound up, however, at a meeting of U.S. sympathizers who were so doting that they hissed someone who asked him about the glasses.

He told all comers that he had not wanted the state of emergency.

"But it was better to do it before I came to the U.N. If I had waited until I got back to Nicaragua, they would say I had met world leaders under false colors, that I was a hypocrite."

"What we don't want is a repetition of the Chilean episode," he explained. "Allende was elected; he was extremely respectful of legal forms and juridical niceties. It is well known what the CIA was doing, but he never put on a state of emergency. We would rather not make the same mistakes. We would rather guarantee our survival by taking these measures than to receive post mortem condolences . . . ."

He spoke of "left-wing extremists," Communists who demand higher wages, more bonuses, more expropriations.

But it is not the "left-wing," the contras, or even the CIA that most threatens his control. It is his fellow townsman, Cardinal Miguel Obando y Bravo, who is spearheading resistance to the draft. He holds enormous rallies where, Ortega says, he "covertly encourages resistance."

"What he says is that no one can be morally or legally bound to fight for a party. He invites people to attend the Lord's call, but they turn into antigovernment demonstrations."

Ortega likes his nemesis. The cardinal knows Ortega's mother, who still lives in their common birthplace, Libertad. When Ortega was imprisoned by the Somoza government, Obando came and visited him. When Ortega and his fellow prisoners went on a hunger strike, Obando joined efforts for their release. When they were freed, Obando flew with them to Cuba.

On the flight, Obando showed "certain sympathies," Ortega said. "But he was provincial. He asked me with great gravity, 'Won't they throw me in jail in Cuba?' He thought all priests were killed in Cuba.

"It's the same with the clergy today. I want their advice and opinions. But when they come they all have lists -- 'My church needs repairs' or 'My road has not been paved.' I tell them, 'You cannot get it out of your mind that any revolution is going to wipe out the church, wipe out religion. You absolutely distrust anything we do.' "

Because of that, Ortega is washing his hands of his congressional sympathizers -- as they doubtless will of him -- leaving Reagan free to continue the inconclusive war and all the misery it entails for Nicaragua.