Scotland would have to leave the UK first, surely.
How that works will depend on Sturgeon and what she negotiates and how she thinks Scotland will vote in Indyref2.
Her preferred option will be to figure something else out, like the federal UK idea. Which is really fucking smart, actually.
But I reckon if she asked for a guarantee that if Scotland voted for independence they would not be forced out of the EU by England's vote, I think she'd get it.