Original: While he was there his hosts played him a traditional Celtic folk tune called "The Craigeelee", and Paterson decided that it would be a good piece to set lyrics to, producing them during the rest of his stay.
Simplified: While he was there the owners played him an old Celtic folk tune called "The Craigeelee". Paterson decided that it would be a good tune to write words for and completed during his stay at the farm.