As Norm says, there is a lot of debate, but several EU officials have stated since the Edinburgh Agreement was reached that there is not a provision to strip EU rights from EU citizens, which Scots are. There would obviously have to be a renegotiation for both the UK and Scotland, but there is no automatic kicking out and having to reapply as an accession member.