This is a very difficult scenario to form an answer to, IMO, but I'll try. Forewarned, this is going to be a very messy situation for EVERYONE involved. Now with that out of the way, I'll try to unbox this thing.
First, we have to look at Louisa herself. Will she convert? As
@Kellan Sullivan points out, Louisa was no religious hardliner, and could be willing to say "London is worth an Anglican service". If she converts after marrying Karl XII, then the Tories will cream their pants. After all, she'd be their wet dream: a legitimate, Protestant Stuart heir in the direct line of succession. Moreover, she's married to one of the most powerful Protestant monarchs in Europe. The Tories under Harley and Bolingbroke would hold her up as a miracle, an example of God's ability to enlighten a wayward sinner to the true religion and begin preparations to repeal the Act of Settlement, likely backed by Ormonde as Captain-General. Anne, embittered, isolated and sickly, would be backed into a corner by her previous statements and her own hatred for the Hanoverians. Now I can't be sure how the Queen will react (she might support it if Louisa will stay out of Britain while the former is alive), but she'll be in a tough position for sure, as she's cut ties with the Whigs at this point and will be quite dependent on the Tories. If Anne does refuse to support the Tories, then we'll very likely see a coup at her deathbed or a civil war. Ultimately though, I'd think Louisa would win the throne. Now this might seem a bit rosy of a scenario, but I think it's quite realistic looking at the situation on the ground.
Second, Louisa refuses to convert but has a Protestant son. Slightly more complicated but still favors the Tories. The main Tory argument will inevitably be something along these lines; only Protestants can inherit the throne, so how can Anne's legitimate Protestant nephew be excluded? It's an argument that would be difficult to counter for the Whigs, and one likely to whip up public support for Prince "Charles". Now this scenario would be similar to the above, but with the caveat of a regency (no idea who would be Regent in this scenario; maybe a council under Ormonde or one of Charles II's bastard sons/grandsons?) and a lot would depend on Anne. Will she support the Tory-Jacobite position and allow a new succession act that invests it in the Protestant issue of Louisa or continue to cling to the Hanoverian succession? The former would be best for England, while the later would lead to civil war, with a good deal of the army supporting "Charles", backed by Swedish troops (Carl XII could make a peace with Peter the Great in order to free up troops to fight for his son's rights). Again, I'd predict a Jacobite-Tory victory.
Now something else to think about is the strong potential of an internationalization of the conflict, especially if there's a peaceful succession in Britain. At this point Sweden is still engaged in the Great Northern war against Russia, Prussia and Saxony-Poland, and British intervention on the side of Carl XII could tip the balance in his favor. Additionally, we could see Hanover enter the war around the same time as OTL, aiming to get Verdun and potentially get involved in a Whig equivalent of the '15 rising. I can't really predict how this would go (the Great Northern War isn't my strong suit), but the idea of a surviving Swedish Empire in union with Great Britain could be a very interesting idea to explore.
Finally, Sweden itself. Assuming that Carl XII dies on schedule, he will be succeeded by his son as Carl XIII. No ifs, ands or buts. The only reason Ulrika Eleonora was able to pull off her sh*t OTL was because the succession was muddled, as Carl XII didn't designate an heir and the heir by primogeniture was allied with the Russians/Danish against Sweden. Now if Carl had two sons he might try to split the succession, with his second son inheriting Sweden, but IDK about that. Later down the line, we could potentially see Charles III & XIII try to divide his domains a la Charles V, with Great Britain & Ireland going to one son and Sweden to another. But that would be it.