Keep in mind, the British parliament can over-rule the Scottish one. The British law could include a clause "none of the above may be changed by the Parliaments of Scotland, Northern Island, or Wales". But contentious laws are already hard enough to pass.
There's tons of little loopholes all over the place. For example, the Isles of Scilly have a slightly strange legal status, and if they're not explicitly mentioned in a law, it doesn't apply to them (I was told this by someone at the council in St. Mary's but didn't ask for the specific statute).
To be honest, if a law is contentious enough for the scots to vote against it, then the devolved parliaments are just as likely push for their national reps to vote against it on the principle that it overrules them.