There is no legal or official definition of what "ordinarily resident" means. One can claim to have moved to Scotland permanently and apply within days of arriving.
There is no way to prove otherwise, because it's all in the intent. As long as one does not proudly proclaim to be pretending to move to Scotland, how would the authorities prove ill intent?
It is perfectly normal for people to realise they've made the wrong decision in moving somewhere and then to move again asap.
So essentially, anyone in the UK could apply. No word yet on validity outside of Scotland though.