Thai artillery sporadically shelled Vietnamese positions along the Cambodian frontier today as hostilities diminished following two days of intense fighting. That troops, who have been reinforced by tanks and armored cars, reported no major clashes.

Most Vietnamese forces appeared to have withdrawn to the Cambodian side of the border. They abandoned two Thai villages and a sprawling refugee encampment they had overrun on Monday. But they continued to send patrols into Nong Chan Camp, a second refugee settlement they had seized.

Tens of thousands of Khmer refugees entered their third day without shelter in muddy Thai forests and on paddy dikes. Foreign medics continued to evacuate wounded refugees from one concentration of about 20,000 people fled Nong Chan on Monday.

Wire service reports said that over 300 wounded civilians had been taken to hospitals at Khao I Dang, a U.N. refugee center seven miles inside Thailand.

In Bangkok, Vietnamese Foreign Minister Nguyen Co Thach arrived for an unofficial two-day stopover enroute home from Indonesia despite the sharp tensions between his country and Thailand. The visit was scheduled weeks ago.

About 800 demonstrators shouted "Stay out, stay out" as Thach disembarked at Bangkok airport. Speaking to Thai legislators who came to the airport to confront him, Thach denied an incursion had taken place but also noted that the frontier was poorly defined where the fighting occurred.

The Thai Foreign Ministry sent no one to greet Thach. However, analysts speculated that Thai leaders would be willing to meet him in secret to try to defuse the border crisis.

Thailand has refused to recognize the Hanoi-backed government in Phnom Penh and maintains close links with guerrillas loyal to Pol Pot's Khmer Rouge government, overthrown 18 months ago.

On Tuesday Thailand cabled the United Nations protesting the "blatant violation of Thailand's sovereignity." The message suggested Thailand might bring the matter before the Security Council.

Thai confidence was jolted Tuesday when the Vietnamese shot down a helicopter gunship and an observation plane, apparently using Soviet-made surface-to-air missiles fired by handheld launchers. Three Thai airmen were killed.

Tonight Thai military officers went on television to reassure the public about the fighting. They displayed Vietnamese pith helmets and other equipment they said had been captured on Thai soil.

Thai spokesmen said all foreign forces had been driven out and the conflict was over. Eighteen Thai soldiers were killed in action, military spokesmen said.

There were unconfirmed reports of movement of Vietnamese troops toward the border, suggestive of renewed fighting.

Hanoi's goals in launching the incursion remain unclear. But it was clearly planned with care. Vietnamese soldiers entering one Thai village brought interpreters who spoke the local language. Those occupying a refugee camp brought large numbers of Cambodian soldiers loyal to the Phnom Penh government.

Most analysts see a dual purpose: to demonstrate Vietnamese military strength and to close down the refugee camps, which shelter anti-Communist Khmer Serei guerrillas and funnel consumer goods and rice to Cambodia's enormous capitalist shadow-economy, which is frowned on officially. c

In Vietnam's view, Thailand has been warned repeatedly not to support resistance groups by giving them food, arms and sanctuary. A program begaun by the Thais last week to repatriate Khmer refugees to zones controlled by the Khmer Rouge and Khmer Serei was the final straw, many analysts believe.

Thus Hanoi policymakers would see the incursion as simple repayment in kind.

Its timing would also serve notice of Vietnamese resolve on the Association of Southeast Asian NATIONS (ASEAN), the economic and political grouping of the five Western-oriented states in the region.

ASEAN foreign ministers are currently meeting in Malaysia. With varying enthusiasm, the states have all supported ASEAN's declaration that Hanoi should withdraw its troops from Cambodia and allow U.N. supervised elections.