there is no precedent if scotland is in the EU after separating from a non-EU country. there would have been one if scotland voted for independence in 2014 and then were talking about joining the EU while britain is still a member.
if spain wants to leave the EU, i'm sure the EU would accept an independent catalonia. that would be the precedent that a newly independent scotland would set.
if spain wants to leave the EU, i'm sure the EU would accept an independent catalonia. that would be the precedent that a newly independent scotland would set.

What kind of government are you advocating?