during the reformation most Poles ended up Protestant, only to come back to Roman Catholicism after the Swedish invasions in the 17th century.
I don't think this is true.
There were protestants in Poland as Poland was probably the most culturally diverse country in Europe. All kinds of dissidents flocked to the country in various waves because of the lack of freedoms in their own, but they were never a force sufficient enough to justify the statement that "most Poles ended up Protestant" at any time in Poland's history.
As a matter of fact, the defence of Jasna Gora and its military and symbolic role in Poland's history may give you some clues.
The first king of Poland then used Christianity as a unifying element (first little link between religion and politics) to bring all the tribes together and make one strong nation – this was officially done in 966 with the Baptism of Poland
That is definitely true, although I'd argue that Poland's native (Slavic) religion could have been enough of a unifying force. As a matter of fact, Christianity was not welcomed by Poles with open arms, and as late as 15 century, in some areas of Poland they still had some basics to cover. Hugo Kollataj, when he received the parish of Krzyzanowice at the end of the 18th century, still complained about pagan customs and resistance to Christianity in the area which is a locaation of some of the oldest chirches in all of Poland. Surprisingly large number of even little villages have little historic treasures dating back to 12th century and before..
There remains another element that seemed of critical importance in the decision to accept Chrsitianity. The western lands were inhabited by Germanic tribes, which by then were Christian, just like much of Europe to the west and south of Poland. Christianity, by the 10th century became a power to recon with. Poland simply stood no chance against Germany (and the rest of Christian Europe ready to help them) in their quest to "legaly" conquer new lands to convert pagans. For the glory of god, of course. Mieszko was smart and did the right thing. Just look how Prussians did. They rejected christianity.
Mieszko was wise to consider neighboring German power. This was an important factor in selecting which nation Poland would turn to in order to recieve baptism. Politically, Czechs, as weaker and less aggressive towards Poland than Germans were a logical choice. That helped Poland find itself outside the formal dependence of the German church (and thus politics).
In a way, and very roughly, think about Poland's acceptance of Christianity as politically similar to Poland's membership in EU. End there was resistance and dissatisfaction with both :)