Your assuming the EU would want them back.
I can't be sure, but suspect they would for various reasons.
Scotland voted 'remain' and has for a long time been a different kind of place from England. (I write this as someone who was born and spent the first half of their life in London, then 'emigrated' to Scotland.)
During the Scots IndyRef one of the key points the 'NO' side trotted out was that to stay in the EU, Scotland had to remain a part of the UK. The EU essentially confirmed this at the time. This assertion by the 'NO' becomes a falsehood now as voting 'NO' seems to condemn Scotland to *leaving* the EU *against their will*.
Previously, Spain was the main opponent of accepting the idea that Scotland could leave the UK whilst remaining in the EU. (Reason being its own internal regional problems, and wanting to send the same message to them as a deterrent.) But with the UK leaving it will no longer be an EU country, and if Scotland *does* become independent, it can be regarded as any other applicant to join.
Given all the current EU problems, I suspect they'd welcome a keen new member, particularly one that *seeks* migration from elsewhere and has a far more sympathetic view of the EU than England.
All that said, I'm not necessarily a fan of Scottish Independence (1), and I'm sure it would be contested. But recent events make me think that if the UK leaves, then there is a plausible path out of the UK and into the EU for Scotland. And it will be hard for the UK to forbid this given what is happening.
{1) I voted 'NO' last time. Mainly because I could see the peril of having to *ask* a bigger combination to 'allow' us to leave *and* that *they* would have to pass the legislation setting all the terms of the 'divorce'. A concern which the UK should have thought about wrt the EU, but simply got the magic unicorn instead with voters who assumed we 'had left' the day after the vote simply by voting.