This is a Scottish version of an Irish tune, published by John Hamilton for the composer William Marshall in Edinburgh in the 1790s, in a small sheet with half a dozen tunes in it. Sheets like that (usually meant mainly for the piano and harp) are now quite rare, and I've never seen one outside a reference library. They often contain the first versions of a tune ever published, but not many of them ever get listed in tune indexes.
This one happens to fit the Pacchioni doppia-S ocarina in G perfectly. These are not a common type of ocarina but I've got one and I love it. I've printed the tune without transposition. The first two parts only need the lower chamber, the third only needs the upper chamber. So you could play it by switching between single-chamber ocarinas in G and the C above, if you can do the switch fast enough (I can't, and wouldn't try with ocarinas that might break if I dropped them).
The second ending is a turnaround for repeating the tune. As usual for Scottish music of this period, the published accompaniment is minimal. It fits the range of a cello, but whether played on a cello, harp or keyboard, you'd use this as the basis for an improvised vamp.
Here's the tune by itself, with MIDIs for the tune and the accompaniment if you want to try "music minus one".
ABC:
X:0
T:Major Lyell of Kinneff's FavoriteZ:Jack Campin, http://www.campin.me.uk
F:http://octunes.blogspot.com
C:Irish
M:12/8
L:1/8
Q:3/8=120
K:G
G2B TBAB TBAB TBAB |G2B TBAB d2B ABc |
G2B TBAB TBAB TBAB |gfe dcB A2B cBA :|
Ggg gec TcBc dBG |Ggg gec TcBc d2e/f/|
geg fdf ece def |gfe dcB A2B cBA :|
g2b Tbab a2c' Tc'bc'|d'2b bag a2b c'ba |
g2b Tbab a2c' Tc'bc'|d'c'b agf gba g3 :|