The intention is when Scotland leaves the Union, Her Majesty will become head of state of an independent Scotland indeed. She will become Elizabeth, Queen of Scots. The Prince Charles, Duke of Rothesay, who also holds the Scottish titles Lord of the Isles as well Prince and Great Steward of Scotland, is the Number One in the line of succession. Followed by His Royal Highness Prince George, Earl of Strathearn.
It is not necessarily bad for the monarchy. As I have mentioned earlier in this thread, a more outspoken Scottish profile for the Windsors can actually work in their advantage. Now they are the embodiment of an Union. So to see, if we have to believe the polls, the Union governed by "Westminster" can not count on a great enthusiasm amongst the Scots. The Queen is the embodiment of that unpopular Union, of "Westminster Rule". A bit more Edinburgh and a bit less Westminster would not do harm for the monarchy in Scotland, so is my impression as an outsider.