According to Simpson (The British Broadside Ballad and Its Music, 1966, 449-455) the tune first appears in print, untitled, in Robert Carr's The Delightful Companion (2nd edn, 1686), at least a year before the events described in the song. I don't know if Piggot is accurate; offhand I can find no reference (apart from his) to There was an Old Man of Waltham Cross as appearing in An Antidote against Melancholy or anywhere else come to that, but that doesn't prove anything in itself.
A connection with the astrologer William Lilly really does seem unlikely, but I suppose anything is possible. Brendan Behan, as usual, should be taken with a generous pinch of salt, as should rumours of the tune being "banned"; such things are usually mythical.