So, May loses the deal, but wins in the no-confidence motion. This is probably the worst combination of results. If either result was the other way it would have been good for her.
Looks like now a second referendum will happen. Not sure how the result would turn out to be if it was held.
But, if a bad deal gets passed, Scotland is sure to break away.
I don't think Scotland is sure to break away because if you think the UK leaving the EU is complicated then rest assured the Scots leaving the UK and then trying to join the EU independently will be fraught with issues... and they will have to apply to join the EU - they don't become part of it by default. There would be two massive negotiations to be had.
New EU countries need to adopt the Euro. The Scots would have to ditch the pound and enter the Eurozone. That's not looking a good choice as it stands.
Bear in mind a few things...
The Scots voted by over 10% to remain part of the UK rather than seek independence. When they had this vote, oil prices were much higher than they are now. They would have to do some major economic re-evaluations as part of their manifesto on another leave the UK vote.
They voted by a wider margin to remain in the EU... but... and this is important - as
part of the United Kingdom. Likewise Northern Ireland voted to remain in the EU
as part of the United Kingdom.
There is not much chance that Northern Irish unionists would vote to remain in the EU if it meant leaving the UK. Union is what they stand for. If you posed the question, "Leave the EU and remain part of the UK" or "Remain in the EU and Leave the UK" then I'd bet my house that Northern Ireland would vote Leave EU in that circumstance rather than the current Remain choice.
The Scottish vote would be less cut and dried than the Northern Irish one, but there is still quite a strong unionist tradition.
Also remember that Scotland's trade with the rest of the UK dwarfs it's trade with the EU.
Since the Scottish referendum, the Scottish National Party (SNP) lost 21 seats in the UK Parliament and 6 seats in the Scottish Parliament. This would suggest that support for Scottish Nationalism is decreasing, not increasing. Of course, this was before Brexit rather than after.
Then we look at sovereignty. This is the biggest issue for me in why I want the UK to leave the EU. So you might ask why don't I think this works with the Scottish question?
In my opinion, it's not comparing like with like. The EU is on a project to centralise power... the UK is de-centralising power. The Scots got a Parliament which gets more powers year by year... The EU is on a march to slowly grab more power year in year out from it's member states. Tax harmonisation? It will happen... An EU Army... It will happen Individual Member State Vetos... slowly being eroded.
So, in short... no way is it a dead cert that Scotland will vote to leave the UK and then vote to join the EU as a separate entity.