The song above first appeared in 'The Scots Musical Museum', #328. Stenhous comments in 'Illustrations to SMM' that there were older verses 'rather too loose for insertion'.I have an old recording of Delia Murphy singing an Irish version.
The tune, "Over the moor amang the heather' is in a manuscript of Scot tunes compiled by David Young in 1740. It was published in P. Thompson's 'Twenty Four Country Dances for the Year 1758, the year Jean Glover was born (Oct. 31, died 1801). Two years later it appeared in Bremner's 'A Collection of Reels'. For other early copies of the tune see SCOTUNS and CNTYDAN2 files on my website.