[Note 184.2]

The source says "If the ditty had any origin in fact at all, the following incident which occurred in Mr. Balfour's own experience when he was a guard on the Dundee and Arbroath line may bear the "wyte." [= Blame (Dictionaries of the Scots Language)]
One day a sailor with his chest entered the Dundee station bound for Arbroath. He had never seen a railway before, and pitching his chest from his shoulder on to the platform be quietly sat down on the top of it, as if to wait the course of events. "Well, Jack," said Mr. B., "are you for Arbroath?" "Yes" "Well, then, you had better take your seat at once." "I think I'll do nicely here, mate." "But you must get into the train, you know." "Oh, hang the train," ejaculated the sailor. "I thought the whole concern went." This occurrence, it will be seen, is partially utilised in the song

Reference: Ford, Robert (Ed) – Vagabond Songs and Ballads of Scotland. (Paisley, Alexander Gardner. 1904) p160