C. M. Simpson in 'The British Broadside Ballad and Its Music', 1966, found no evidence for song or tune in the 16th century, nor have I. I've found one thing not found by Simpson. There is a copy of "From the hag and hungry goblin" (in the other thread) in Bodleian MS Tanner 465, where the song is headed 'Tom o' Bedlam's Song to K. James'. This seems to point to a court masque in James I's time as the source of the song. ("Last Christmas 'twas my Chance" (The Dance of the Usurer and the Devil) in 'Pills to Purge Melancholy' is from a masque of 1622, and Simpson did not find that, or its original tune.)As to the two lines in King Lear that are sung by Edgar, they do not occur in any known version of "Tom o' Bedlam". But this isn't conclusive. I've spent considerable time on study of song fragments in Shakespeare's plays. Some of these have been identified as lines from particular songs, but I've come to believe that Shakespeare more often parodied songs than quoted them, and these parodies are practically impossible to identify with particular songs with any great degree of certainty.