Probably. It requires finding a job, or having a lot of money, though, as you aren't immigrating to Scotland, but to the UK. UK's visa and immigration website [1] is actually very straight forward and easy to navigate for anyone wanting more info.
> What's actually required to gain residency (and is it permanent)?
There are a few paths to permanent residency (not necessarily citizenship). The simplest is via by getting a job that sponsors your visa and staying at it for 5 years, and then applying for right to remain. You will not be a citizen, but you will have the right to stay regardless of your job, and may be eligible for public funds.
The next best option is the Entrepreneur Visas. Option 1: £200k of your own money (can be from friends, family investors, etc) ready to invest in starting a company, or Option 2: £50k of money from registered UK VC fund or a UK government seed grant (not sure how easy this is).
Both options give you a 3 year visa extendable to 6 years 4 months, and at 5 years, you are eligible for the right to remain in the UK.
> Is there a path to citizenship?
There definitely is, but it is complicated, and maybe unnecessary. There is a kid on YouTube [2] who talks more about this.
> And with Brexit looming, will this all change in a few years?
I'm not a soothsayer, but I'd wager most of my weekly allowance (~$70) on yes.
Even if the UK moves to a points-based system post-Brexit, I'd imagine a mid- to late-career software developer or similar would easily be able to clear any 'desirability' / skill requirement and salary hurdles.
(Although trying to predict policy post-Brexit is probably a losing game. There's any range of choices from 'the UK doesn't leave the EU' to 'the UK leaves and Scotland leaves the UK').
That’s the policy of pretty much every western nation. Which they’ve all benefited from greatly.
Migration is crucial to the development of Scotland as an inclusive, fair, prosperous, innovative country ready and willing to embrace the future. It is essential to our economic prospects and our demographic sustainability that Scotland continues to attract the level and nature of migration it needs. Migration is not just about economic prosperity. It has helped to shape Scotland – just as people born in Scotland have helped to shape nations across the world so people migrating to Scotland have shaped and changed our own country. People from overseas who come to Scotland to live, to study or work, or to raise their families are our friends and neighbours. They strengthen our society and we welcome them.
I can, of course, also recommend Edinburgh - surely one of the worlds great wee cities: "But Edinburgh is a mad god's dream"
https://www.buzzfeed.com/hilarywardle/edinburgh-is-the-best
The rest of Scotland is mostly pretty nice as well ;-)