It will be a choice for the rUK Govt whether they want to end freedom of movement with Scotland, or have a similar agreement as they do with RoI. The result of the negotiations with the rUK, then Scotlands decision on it's relationship with the EU, will, depending on that decision, I agree, may cause a problem with the England/Scotland border. Again though, that'll be a choice for the rUK , whether it wants to continue with it's isolationist policies.