When congressional passions were rising last month on the subject of trade protectionism, President Reagan's advisers carefully prepared a meeting between him and Republican leaders of Congress. Reagan delivered the conciliatory message his aides had drawn up on written "talking points," declaring his willingness to cooperate in defusing pressures to restrict imports.

As soon as Reagan had finished the prepared remarks, the senators and congressmen renewed their demands for import restrictions. Reagan responded by ignoring the guidelines he'd been given and firing back with an impassioned lecture about the dangers of protectionism -- exactly what his advisers were trying to avoid.

This episode, recounted by a White House official, illustrates one of the great uncertainties about Reagan's performance when he meets Soviet leader Mikhail Gorbachev in Geneva. No amount of advance preparation can prevent Reagan from being himself. Once out of the spotlight, Reagan is often a free-flowing, anecdote-laden raconteur who does not stick with the "program" that others would devise for him.

One longtime associate calls this the "X-factor" for Reagan. He is almost certain to depart from the "program" in his eight hours of discussions with Gorbachev. These departures may be a wisecrack, or a story, or a commentary Reagan has picked up from some publication or even a movie long ago.

"There is an X-factor, we see it every week," said the associate, who has spent many hours with Reagan going back to his 1976 presidential campaign. "We saw it last week in the interview with the Russians," in which Reagan offered a confusing account of the future of his missile defense program. "Its impact, nobody quite knows," he added. "The Soviets are probably learning, if they don't know now, there is an X-factor."

Says another longtime adviser: "Reagan will be disarming in the sense of the anecdotal charm. But God help us if he does something from Human Events," the conservative weekly that Reagan has read avidly for years, sometimes quoting from it publicly, to the consternation of his advisers.

Reagan brings strengths to the summit, too. By all accounts, he can be charming and self-confident, even under fire from an adversary. He can respond to harsh criticism with equally powerful debate. Reagan has told aides he hopes to use the force of his personality to convince Gorbachev that he wants to ease tensions between the superpowers and that he fervently believes in his proposed space-based missile defense system.

Reagan often tries to use stories and anecdotes to establish a personal relationship with an adversary. In preparing for this summit, the president has tried to focus on Gorbachev's personality, background and "chemistry," as one White House official put it.

"He's always felt anyone he could sit down with, he could charm," said former Reagan political adviser Edward J. Rollins.

But Reagan may be vulnerable in the sense that some of his impromptu remarks over the years have turned out to be embarrassing, wrong or hopelessly irrelevant. Fresh evidence of this was provided in the final two weeks before the summit, as Reagan left behind a string of question marks in interviews about what he meant to say on the vital issue of his missile defense system.

In one interview, Reagan made the kind of mistake that some officials fear could be serious in Geneva. Speaking to European broadcasters, he said, without being asked about it, that the United States was willing to "engage" the Soviets in a discussion of their longstanding proposal for a nuclear-free zone in Europe -- something the United States and its European allies have long opposed. In one remark, Reagan contradicted NATO doctrine.

In other comments over the last two weeks, Reagan wrongly stated that there is no word for "freedom" or "compromise" in Russian. He suggested that he would share with the Soviets -- and then sell "at cost" -- the results of his missile defense research. He also said he would not deploy the system until nuclear missiles were eliminated, then reversed and said he would deploy it unilaterally if other nations refused to join the U.S. in reducing their arsenals.

A senior White House official acknowledged yesterday that "we've had to exercise damage control" after these presidential missteps. But the same official noted the pitfalls of overburdening Reagan with detailed information, recalling his disastrous first debate with presidential candidate Walter F. Mondale last fall.

For all the mistakes, it has become an article of faith among Reagan's advisers that he is often underestimated by his foes. They point out that political rivals, including Democrats Mondale and Jimmy Carter, seized on Reagan's incorrect comments many times, but he still beat them handily.

However, these advisers acknowledge that the meeting with Gorbachev is not the same as a political campaign or a nationally televised debate. A slip about the nuclear-free zone, or a provocative anecdote, could affect the tone of the discussions and perhaps leave Gorbachev with the wrong impression about Reagan. Unlike past summits, the Soviets are expected to have a sophisticated public-relations apparatus of their own in Geneva that could exploit a Reagan slip.

"It's hard to correct the record in a situation like that," says one official.

One of the biggest risks for Reagan is the format of the talks. Unlike a political debate or even a difficult interview, where he could filibuster a question, the summit meetings will test his ability to stay engaged with Gorbachev over several hours. This is particularly important because the talks start with a one-on-one session between the two leaders that officials say could set the tone for the entire summit.

Reagan has often risen to the occasion and privately argued with his critics -- once denouncing Candian Prime Minister Pierre Elliot Trudeau in a meeting with other western leaders -- but he is not known to have a long attention span. "He gets bored," commented a longtime aide. "I'm not sure he's going to be disciplined enough."

Reagan probably will not be called on to negotiate details with Gorbachev, a task that could really be troublesome for him. Reagan prides himself on his negotiating skills from his days bargaining for the Screen Actors Guild. But for most of his presidency, Reagan has laid down markers for his subordinates and let them do the bargaining -- as he did on Social Security and budget issues, and as he would like to do now with arms control.

"Ronald Reagan is not an arms negotiator. Don't burden him with details and expect him to be Paul Nitze," says James Lake, a former Reagan campaign press secretary. "He has a basic understanding of broad goals and problems and how to go about solving them. Let him alone to do what he does best -- convey ideas, notions, a vision of where the country ought to be."

The senior White House official says Reagan has been thinking about the Soviets and communism for "better than 40 years," going back to his Hollywood days. Reagan told a story illustrating this to his top foreign policy advisers yesterday as he was getting the final briefing before departing for Geneva, the official said.

Reagan said he and Nancy Reagan went on a trip to Honolulu in the 1950s, the days when he didn't take airplanes. They were sitting in their suite on a cruise ship when there was a knock on the door, and the purser and ship's officer appeared with their luggage.

The president said he asked why the purser and ship's officer were bringing him the luggage.

It turned out, Reagan recalled, that leftist longshoremen would not handle the bags of that "damn anticommunist, Ronald Reagan."

The senior White House official added: "He uses it as an illustration that he's been concerned about communism and the like, he's been studying it for years, has been schooled in it. He was recalling the visit of communist leaders to Sacramento when he was governor. Reagan feels that after all these years of study about it and the like, that he's comfortable in discussing Soviet and communist relationships with the United States."