Firstly, economically, the remainder of the UK is a far larger market for Scotland than the EU. This wouldn't be a big issue if the UK can negotiate very good access to the single market but that's highly questionable. It also is complicated by the second point.
Secondly, it is highly unlikely that Scotland would be able to (re)enter the EU without joining the Euro. There are other exemptions the UK has that Scotland won't get but this is the biggy. It was the SNP's original economic plan to join the Euro. However, when the Euro went politically toxic following the crash, this was dropped and pretty much killed SNP's economic argument in the independence referendum. It's still pretty toxic but is probably less so given that the EU referendum has hosed Sterling.
Thirdly, a big issue in the independence referendum that hasn't gone away is that an EU entry requires unanimity and Spain are dead against separatist movements because of the Basque situation. It's possible that they will have their arm twisted by the EU commission if it means another net contributor added to the Euro block but it's not clear cut.
Fourthly, legally, they don't get to choose. They can't officially negotiate with the EU as they aren't treaty partners. Only Westminster can legally grant separation. If Scotland had voted independence the first time then it would have been followed through without a doubt. It is entirely possible the UK parliament will refuse a second time because of the outcome the first.
As to NI, all of the above and then some. The whole of the Troubles was really about NI's status in the United Kingdom and giving that up is unlikely to be a quiet affair. Maybe it won't become violent but there's more history there than in Scotland.
In short, I wouldn't even begin to know how to call this.
Why? There are plenty of EU countries without the Euro..
From the EU's perspective, in order for them to go against the anti-separatists such as Spain, they'd need to have a big carrot. My guess is that full EU i.e. Euro, no opt outs and no rebate would be sufficient as it's fully in keeping with the "ever closer union" agenda. I can't see anything less being sufficiently beneficial to the EU to make the necessary compromises worth it.
IE could it grow fat being the middle man between the Leavers and the EU?
It's probably worth pointing out also that, currently, the UK has a lot of wiggle room when it comes to its relationship with the EU just because of its size. It is very unlikely that Scotland will be given any of this both because it's relatively small, economically, and it won;t be in a good negotiating position.
It could be said that Scotland wanting to stay would be politically super-popular with the EU, who strive to draw a sharp divide between the benefits of the EU and the costs of leaving. On the other hand, England could see the compromise where Scotland is its trade partner in Europe as a win-win too.
From the EU perspective, my own view is that if Sturgeon can find a way to persuade Scotland to go the full EU i.e. Eurozone, no opt outs and no rebate then I can definitely see Juncker finding a way to accommodate by doing some sort of quid pro quo with Spain. Whether the Eurozone economy will recover sufficiently (and/or the UK economy will tank sufficiently) to make that politically viable is anyone's guess.
For NI, if it wasn't for the super strong unionist movement, I'd say that there was a lot to be said for them going full EU: they're small, relatively poor, bordering Eire. But that's a really, really big if, probably enough to kill any real chance of it occurring in the next 20 years.
Perhaps England can leave the EU but other NI and Scotland stay?