After sundown here Saturday, the Pan American Games competition ended on much the same note as it began.

A Virgin Islands marathoner, finishing an hour after anyone else, arrived at Sixto Escobar Stadium to run his last lap and receive his cheers as a reward for pain.

The gates were locked, the stadium closed and everyone had gone home.

Throughout Pan Am's two weeks, escapades ran neck and neck with excellence, hijinks a dead heat with highlights.

If this hemisphere Olympics, conducted in a beautiful Caribbean sauna, was short on world records, it was amply filed with excellent competition and a delightfully heady sense that everybody concerned was operating on about half a tank of pina coladas.

Everything here had its opposite - its anecdotal antidote

If United States swimmer Cynthia Woodhead could win five gold medals, including one rewriting her own world mark, then brilliant U.S. softball pitcher Kathy Arendsen - who had a perfect game and another no-hitter - could be soaked in the middle of the night by a water bomb shot high-rise to high-rise by U.S. men who built a huge slingshot out of rowers' oar.

If American trackmen James Robinson and Tony Darden could beat Cuban great Alberto Juantorena at his 800- and 400-meter specialties, then that same Cuban horse, phlegmatic in defeat, could be drawn into a cursing match through a wire fence with two of the three Cuban team members who defected during the Games.

No glory could be totally untainted. The United States, as always, dominated the Games in which historically it has won 59 percent of all medals. As in 1975, the U.S. won upward of 100 more medals than its nearest competitor - Cuba.

The Yankee strenghts were customary - 32 of 33 golds in swimming, 10 of 10 in freestyle wrestling, plus the usual haul in track. Shooting, roller skating and archery proved to be little-noticed gold mines.

Even as the young U.S. boxing team returned to prominence - holding Cuba to a standoff for overall top honors - the world champion women's basketball team was shocked and defeated by Fidel's Five.

At every turn, however, the Games seemed anxious to lapse over into slapstick.

The leader of the pie-in-my-own-face crown was Bobby Knight, the U.S. basketball coach, who demonstrated again how to act like a loser while winning.

It is not necessary to make an encyclopedia of the minor calamities, the snickering snafus that made the rounds almost hourly.

A typical final note was Dr. Roy Bergman, physician to the U.S. boxing team, standing in the airport today after being notified that not only was his flight off the island canceled but that all flights were so overbooked that - like hundreds of Games visitors - he might find it impossible to leave Puerto Rico before Wednesday.

"Maybe the Cubans had the right idea," Bergman ventured. "They all left last night - on their own boat."

The constant refrain in this Caribbean paradise, where inconvenience and perfumed winds, scenic beauty and wasted time go hand in hand, is that these Pan Am Games had no more problems than Cali, Colombia, in 1971, or Mexico City in 1975.

In other words, this quadrennial festival is now expected by knowing observers to combine athletic competition and official incompetence, a vacation mood amidst a rain of petty hardships.

That assumption, especially in the case of Puerto Rico, misses several crucial points. Here, the excuse, "no worse than usual" comes up shy.

Cali, after all, is not going to have a referendum in 1981, as Puerto Rico is, to see if it will come before Congress for Ratification as the 51st state in the Union.

Cali does not have 60 percent of its population on U.S. welfare, nor were 80 percent of its Pan Am expenses footed by U.S. taxpayers.

Finally, and most crucially, Cali has not had Puerto Rico's mixed blessing of being underwritten by American dollars for 60 years as a commonwealth - that is to say, a colony.

The most conspicuous, ever-present facet of Puerto Rico's Games was the way they revealed the generations - old fruits of benign but smothering colonialism.

This island has been America's most undisguised venture into decades of paternalism. Historians do not debate the point, they merely discuss it consequences.

The island's people are split between an ungrateful resentment toward their gringo money manipulators - a spiteful, half-hearted rebellion - and a degrading form of friendship in which it continually eats at Puerto Rican pride that islanders, although U.S. citizens, are not true equals.

Friday might's basketball final, for instance, had a depressingly profound meaning for Puerto Ricans.

The Roberto Clemente Coliseum was full and guards blocked the gates more than two hours before the game. Without question, that contest was the most prevalent subject of discussion here - of any subject, athletic or political, during the 15 days of the Games.

Once more, many Puerto Ricans were locking themselves into no-win corner of defining themselves, basing their evaluation of their own worth, in terms of the huge "Estados Unis" to the north.

"If we had won," said one islander in the crowd after the 19-point U.S. victory, "no one in Puerto Rico would have slept until dawn."

Actually the most touching aspect of the Games was observing Puerto Ricans - so gifted in the arts, so devoted to a relaxed quality of life with long, slow meals and the cultivation of conversation, trying to force themselves to meet North American standards of efficiency.

When the memory of the 1979 Pan American Games has faded - of Renaldo Nehemiah crushing Cuban insulter Alejandro Casanas or the 17-year-old bantamweight Jackie Beard inspiring a whole team of boxers, one image will remain.

It will be Jesse Vassallo, standing on the victory platform, still dripping from his latest world swimming record.

The Star Spangled Banner is playing. He is waving the one-star Puerto Rica flag. One anthem and another - the island's hymn - begin with the crowd singing spontaneously.

For a minute there is unity, a glimpse of the future when a moratorium may be declared on Puerto Rico's decision: on whether to love or hate America - on whether to love or hate itself.