You would not be entitled to a working visa based on ancestry - it's too far back! But, try to make sure you study for a degree that has relevance to Scotland's (indeed the UK's) needs, eg medicine or teaching or similar and then you might be allowed a work visa. Make sure the degree is to the required standard, too!
