Maggie meets a piper, Rab the Ranter, and encourages him to strike up a tune while she dances. He does, and she praises his work; he says, "It's worth my while to play indeed When I hae sic a dancer." She encourages him to ask for her if he comes again
One can only suspect that more than piping and dancing lies behind this song. This, indeed, may explain its rarity in the older collections; it sounds like a hidden story of something extremely indelicate. (The National Library of Scotland site, in fact, claims that Maggie ended up pregnant. The NLScotland broadsides do not show this, however.)
Habbie Simpson, to whom Rab the Ranter is compared, was a historical person, living in Kilbarchan (near Paisley) in the late sixteenth century; it may be significant that the father of Francis Sempill, Robert Sempill (c. 1595-c. 1665; not to be confused with another Scots poet named Robert Sempill, 1530?-1595), composed Simpson's elegy, _The Life and Death of the Piper of Kilbarchan, or the Epitaph of Habbie Simpson_ (c. 1640).
There is a broadside text (not a song) about Simpson at NLScotland L.C.1270(019), "Habbie Simpson and his Wife," unknown, c. 1845.
I don't know if Maggie and Rab are historical. - RBW