The Polish government today heralded the visit of Pope John Paul II as an event of "enormously positive value" that confirmed the Communist-led stabilization of the country and broke its isolation by the West.

Delivering the government's first formal review of the visit that ended yesterday, Religious Affairs Minister Adam Lopatka told a session of the legislature that the pilgrimage affirmed points of church-state agreement and generally took place "in an atmosphere of popular interest, calm and dignity" despite what he described as attempts by western-supported underground and opposition forces to use the religious gatherings for "ignoble ends."

The Vatican newspaper L'Osservatore Romano said Lech Walesa had "lost his battle" and indicated the leader of the banned Solidarity union was no longer in a position to play a major Polish role, The Associated Press reported from Rome.

Lopatka's statement appeared to reflect a decision by the government of Gen. Wojciech Jaruzelski to put the best possible face on the visit rather than to try a counterattack against the popular pontiff, whose homilies included veiled but penetrating criticisms of current Warsaw policies. The week-long papal tour drew millions of pilgrims to western and southern Poland for open-air masses that often had the appearance of pro-Solidarity rallies, embarrassing for the government. Vast crowds cheered the pope when he urged Poles to continue to stand up for their rights and have faith in eventual victory, and when he associated himself with their suffering and the ideals championed by Solidarity.

Jaruzelski, having staked his rule on a policy of far-reaching accommodation with Poland's powerful Roman Catholic Church, is now in the position of justifying the papal visit to party colleagues and to the Soviets--who cannot have been happy with the renewed displays of fervent Christian celebration tinged with antistate sentiments.

Jaruzelski's bid to claim some common ground with the pope was clearly helped by an unexpected second meeting between the two leaders Wednesday night in Krakow. While the contents of the talk remain publicly unknown, it yielded a photo of the two shaking hands cordially that was on the front page of the main party daily and other papers today amid commentaries interpreting the trip favorably and accenting church-state accord.

"Let me point out," wrote editor Zdzislaw Morawski of the main Warsaw paper Zycie Warszawy, "that John Paul II gave eloquent expression to the value of and need for confidence, conciliation and dialogue. This is certainly a significant element of this visit, which is of permanent value to all Poles."

The government has hinted at plans to abolish martial law, suspended last December, on July 22, Poland's independence day. Action on other demands by the church and opposition groups--notably, a blanket amnesty for political prisoners and the reinstatement of those dismissed from jobs for political reasons--is less certain.

The government formally dissolved the Polish artists' union this week. The union, among the largest cultural organizations in the country, drew the ire of the Communist leadership by refusing to retract opposition to the outlawing of Solidarity.

In another move suggesting a hardened stance against critics, the government today announced it was suspending Poland's membership in the International Labor Organization, a U.N. agency that last month decided to open a formal inquiry into Polish labor practices. It came in response to Poland's refusal to answer questions on alleged violations of trade union rights.

Reporting on the papal visit, Minister Lopatka said the government had timed the event right since it showed that "the process of agreement and national rebirth" as well as church-state relations were well advanced in Poland.

Listing benefits of the visit, he described the pope as the first head of a western state to come to Poland "in recent times"--meaning since imposition of martial law 1 1/2 years ago.

The government has sought to play down the differences in views and long-term programs outlined by the general and the pope in the past week. But belying a nervousness in government circles about some of the things the pope said, censors have prohibited publication in the Catholic weekly Tygodnik Powszechny of his appeal to youth, delivered at Jasna Gora Saturday night.

The pontiff sympathized then with the difficulties and sufferings of Polish youth and what he described as their lack of prospects for the future.

The AP, in its report on Walesa, added:

At the same time that the Vatican newspaper said Walesa had "lost," the Holy See withheld release of a photo of Walesa's private meeting with the pope on Thursday.

While L'Osservatore Romano is published by the Vatican, it does not necessarily reflect official views of the Roman Catholic Church. Vatican spokesmen could not be reached for comment.

In a sometimes cryptic front-page editorial called "Honor to the Sacrifice," L'Osservatore Romano said that Walesa "had to meet the holy father as a private person in a secret manner without demanding to count any longer in the present phase of life in his country."

"Officially Lech Walesa once more leaves the scene," said the commentary signed by deputy editor Virgilio Levi. "We can say that he has lost his battle . . . . Sometimes the sacrifice of uncomfortable people is necessary so a higher good can be born for the community."

In Gdansk, the labor leader's wife Danuta was asked about any discussion with the pope of Walesa's future role. "I was there and they didn't talk about anything like that," she said.