Scotland can choose to apply for membership of the EU
Once independent with its own currency, Scotland can apply for EU membership. This may take a couple of years. In the interim application can be made to EFTA and to joining the customs union they enjoy with the EU.