The formal criteria are that a country is a stable market democracy, other than that accession is really a political matter (see Ukraine and Turkey). Clearly there would be a groundswell of support for incorporating a Scotland fleeing from Brexitland. It would be a coup for the EU.
Sure, but that is politics. Given the overwhelming view of the EU will be to admit Scotland, there would likely be a quid pro quo. Spain would drive its bargaining position to extract concessions from the rest of the union in exchange for its consent.