There are two old songs to the tune (before Burns)--both are given with the music in the Scots Musical Museum (1787), and previously in David Herd's anthology, Ancient and Modern Scottish Songs, 1776. The second (anonymous) is a love song, and mentions the castle only once:
From Roslyn castle's echoing walls,
Resounds my shepherd's ardent calls,
My Colin bids me come away,
And love demands I should obey.
etc.--if you really want this I can always post it.
There may well have been much older words (pre-18th century I mean), but they appear to be lost.