He agreed to get the Lannisters off his back, some claim to the titles he was going to need, and safe passage out of the Riverlands. But once he got into the North, Roose knew that he would be too far away for the Lannisters to do anything about.
So I’m pretty damn sure Tyrion and Sansa would have been killed by “Ironborn raiders” if the Purple Wedding hadn’t intervened.