I suspect the folk process looms large in nonsense songs, because the nonsensical verses can be interchanged. I remember the "peeping through the knothole" and the "boy's best friend" lines. Additionally, my memory hasn't been tested on some of these songs for a long time, so I may be mixing and matching words.Some songs that seem like nonsense today probably made perfect sense when they arose. The ham and eggs verse above--if it were written during one of the World Wars when those were in short supply, then this would be a Big Rock Candy Mountain sort of song, and the emphasis on "smell" wouldn't mean "stink." Just speculation, however.
SRS