At one time, the Pan American Highway passing through this small town near the Nicaraguan border was crowded with trucks and tourists.

The trucks carried goods among members of the Central American Common Market, supplying nearly 30 percent of Costa Rica's foreigh trade. For tourists, the highway was part of the only direct route through the Americas from Alaska to Argentina.

Now, the border is closed and the only traffic on the 20-mile stretch of highway from La Cruz to the fronteir is an odd assortment of pickups and heavy transports carrying supplies to Sandinista guerrillas, who are against Nicaraguan President Anastasio Somaza.

While the Nicaraguan civil war has brought destruction and genocide in that country, neighboring Costa Rica has suffered in more subtle ways.

An overwhelming popular desire to help the Sandinistas, coupled with a wish to remain officially neutral and avoid both overt intervention in a foreign war and the possibility of Somoza's revenge on Costa Rican territory, has resulted in a sort of national schizophrenia.

For Costan Rican President war has been an extended nightmare. His government is blamed for severe local economic diffidulties it has caused, but it is prevented from addressing them because of its own Sandinista sympathies and those of the Costan Rican people.

The Central American Common Market has practically ceased to function here. The few goods sent out go expensively by air. Costa Rica's traditonal $30 million trade surplus with Nicaragua is gome, as all trade between the two countries is stopped.

"The whole economic situation is shaky," one Costa Rican businessman said. "All road transportation to northern Central American markets is gone."

At the same time, Nicaragua has long supplied many of the raw materials for Costa Rica's small manufacturing sector, including raw plastics and other petroleum derivatives.

On a human level, Costa Rica now estimates it has accepted more than 100,000 Nicaraguan refugees who have fled the fighting. In huge refugee camps in the north, in the homes of many Costa Ricans, or among their own Nicaraguan relatives who have previously moved here, most have been enrolled at enormous expense into the government-subsidized national health plan.

The Costa Rican government has had to deal with epidimics brought from the war-torn north, including an outbreak of polio.

In San Jose alone, an estimated 3,000 Nicaraguan students have been enrolled in high school.

"For a small economy like ours, war in Nicaragua is very expensive," one Costa Rican political analyst said.

Somoza has blamed Costa Rica, considered a model Latin American democracy, for many of his troubles. He has charged direct Costa Rican complicity with the Sandinista National Liberation Front, accusing the government of allowing the guerrillas to establish training and base camps in the northerm Costa Rican mountains.

"No Costa Rican will publicly say we should dump the Sandinistas," the analyst said. "That would be treason. It's true that there couldn't be a war in Nicaragua if there were not a country like Costa Rica next door."

Costa Ricans' hatred of Somoza goes back long before the current civil war to a series of incidents in their own territory they have never forgotten or forgiven. In 1948, when former Costa Rican president Rafel Angel Calderon lost a reelection bid and sought to unseat the legitimate victor, a civilian uprising resulted. Its leader was farmer Jose "Pepe" Figueres an antidictator, anticommunist social democrat.

Calderon's unsuccessful battle against Figures' peasat army received substantial aid from Somoza. And when Figueres later assumed the presidency, it was as a bitter enemy of the Nicaraguan president. Calderon took refuge in Nicaragua, trained an army and in 1955 invaded Costa Rica, again unsuccessfully, with Nicarguan support.

One of Figueres' firts presidential acts had been to dissolve the Costa Rican army, replacing it with a small, poorly armed civil guard. When the Sandinistas began preparing for all out war against Somoza in 1977, setting up camps inside Costa Rica, there was little the civil guard could or wanted to do so stop them.

"Many, many of my friends have taken the Sandinistas into their homes," the businessman said. "I didn't know until a few days ago that my own son has been training with the Sandinistas at night and on weekends. I'm proud of him."

Officially, Costa Rica provides no assistance to the Sandinistas and has no knowledge of their activities along its border. Unofficially, Costa Rican authorities have been reported to turn their heads to guerrilla movements and the clandestine arrival of Sandinista arms shipments.

The Costa Rican Red Cross, aided by a team of 18 recently arrived Mexican volunteer physicians, operates several northern clinics whose main customers are wounded rebels. While the border area was long unattended by Costa Rican officials who wanted to stay away from the fighting, the civil guard has now stopped all traffic, except that of Sandinista vehicles, at Las Vuelts, a point five miles from the frontier.

There are reports that some fighting between the Sandinistas and the National Guard has occurred inside Costa Rican territory. Last week a contingent of 30 Nicaraguan soldiers was rumored to have parachuted into Costa Rica near Las Vueltas.

Both Venezuela and Panama have pledged assistance to Costa Rica in the event of a real invasion from National Guard troops chasing Sandinistas across the border, but Carazo apparently is reluctant to bring the situation to the point of international war.

Some Costaa Ricans, especially conservative businessmen, fear possible communist ties among the Sandinistas, although they are supporting the guerrillas' efforts against Somoza. And Carazo's main interest seems to be getting the war over with the least internal political and economic damage possible.

"If the government stops assistance to the Sandinistas," a Costa Ricaw journalist said, "it's in trouble. If it keeps aiding the Sandinistas, it's in trouble. The answer is, let's get rid of Somoza and end this war as soon as possible." CAPTION: Map, no caption, By Dave Cook -- The Washington Post