Burns' song is in 'Scots Musical Museum', #417 (1796). With 1st verse and chorus switched around it is in DT. It is not quite clear where the another version, SMM #418, came from.There is a more explict version in 'The Merry Muses of Caledonia' (1799) where one verse of six goes:
Gin a body meet a body,
Comin thro the rye;
Gin a body f--k a body,
Need a body cry.