I suggest they get engaged in 1630, and Ulrik doesn't die in 1633, as such I think the alliance would stay stable. If Christian IV can see a better than average chance that his son can become king of Sweden, he will go very far to o keep the Swedes happy and not break the engagement. While for the Swedes Ulrik is two persons from the Danish crown, which is far enough that they don't risk a union. Of course with Ulrik as king in 1640 it's going to change Swedish and Danish behavior in the last part of the 30YW. As for persons, Christian IV will be a complete different person rather than being king which was defeated in the 30YW and Torstensson War, he will be the king which got Sweden back under the Oldenburg dynasty even if it were a sideline, so he will likely be less bitter and unhappy, and more proactive.
But that way Christian will still be defeated in the TYW and make his peace with the Emperor 1629 which might off set Gustavus as Christian promised not to reenter the war.
Guess we need a POD as of 1628 prior to the battle of Stralsund; problem is Gustavus probably won't hand his daughter to Ulrich at this point with the Danes just fresh out of defeat... must do something to make Gustavus really want the alliance like loss of the Swedish navy or Spanish warships arriving in the North Sea demanding passage into the Baltic.