Spain will try to block Scotland entering the EU, to fend off Catalonian separatism.
If there's another Scottish independence referendum, Scotland would gain independence from a NON-EU country (UK) and then apply to join. This is similar to the situation with Slovenia, which gained independence from Yugoslavia and then joined the EU. Spain didn't veto that.
Very slim chance though, seeing as it was mostly the Labour heartland that voted for Leave.