My guess though is that the EU won't be keen on the UK splitting up and thus won't encourage it by providing Scotland a quick ascension.
This is also a wonderful bargaining chip for the EU to play against Theresa May in negotiating the terms of the UK's exit.
Yup. "You lot can leave, but we'll take Scotland. Your choice."
Maybe Spain would let in Scotland and claim Gibraltar as their own?
Is just that not the UK neither the people in Gibraltar want that. But yes, Gibraltar could face some problems when the UK leave the UE.
Long version: https://en.wikipedia.org/wiki/Disputed_status_of_Gibraltar
Germans are going to face a large hike in their contributions to the EU in the next few years as the UK leaves, as the EU appears to be utterly incapable of actually spending less (despite now having diminished responsibility). That's just not in its nature.
So then Scotland comes along. The best available data says it's an economic basket case significantly worse than Greece. The UK subsidises it to a great extent for historical and cultural reasons that don't apply to Germany. Meanwhile, 40% of Scotland voted out of the EU as well.
If you're German and already questioning whether you should be subsidising lots of low productivity high debt Mediterranean countries, does the thought of waiving the entry requirements and then paying even more taxes to subsidise a new Greece appeal to you?
Previously they said that if the UK left the EU, and Scotland left the UK, they could take on the UK's EU membership. This seems to be what they're aiming for with saying they want the referendum before the Brexit process is complete.
That said, it's never been confirmed that would actually be allowed, and with the UK government likely to trigger Article 50 this month, I'm not sure the door is even open for that. And given the EU's fairly strict and slow entry process, as you say, Scotland could be left outside of both unions for many years. I'm not sure if they'd even satisfy the EU's economic requirements on their own.