Re-joining the EU will not necessarily take years
. There is no "queue": accession states can join once they meet the entrance criteria. Given that at 23.00 on 29 March 2019 the UK will still meet the criteria that they met a minute before (and if you believe what May says about continuing to match/follow EU regulations during transition
, will continue to do so until the end of 2020), then Scotland, as a current constituent country within the state of the UK, will itself meet the criteria.
The longer Scotland leaves it and the more that the UK Government gets into bed with the USA with its desperation to get a deal, any deal the harder it will get as potentially the more that the UK will diverge from the EU - especially given that the trade talks with the USA will be held in secret 
The one area where Scotland might have a difficulty is some of the financial criteria (the UK wouldn't currently meet them
). However, this would just delay joining the Eurozone, which may not be a bad thing
- or we could do what Sweden does, which, although it has committed to join the €, never quite managed to meet the criteria 
It would surprise me if Nicola, who is an astute and capable politician, hasn't been doing a lot of soft diplomacy, getting agreement in principle amongst the E27 that if Scotland were to relatively quickly achieve its independence, then it could go into some sort of "holding pen"/EFTA membership while the detail is sorted out.
If WM can seriously consider a hard border in the island of Ireland, with all the risks that that would involve
, then, much as I would rather not have one, a hard border with England is also possible.
Such a scenario might actually give a boost to Rosyth, Greenock and Port Glasgow (and even Cairnryan), to build up their freight capability direct with the EU.