It's always nice toclear up something which has been bothering you and thanks to the leads given above I think that this particular poem/song has been sorted out.
I found some poetry etc., by William Maginn at this address (which incidentally has lots of English poetry texts) http://dlib.stanford.edu:6520/text/engpo.html
go to: Early Nineteenth-Century Poetry, 1800-1835: William Maginn: Maginn: Miscellaneous writings (1855-57): The Odoherty Papers Vol. II One of the poems is "Farewell Beggarly
Scotland" so maybe Maginn wrote it under his pen-name on the occasion of his move to London and Hogg replied in kind.
William Maginn, born in Dean Street, Cork City, in 1793, was so learned a youth that he entered Trinity College, Dublin at the age of ten and by the age of fourteen had become the second youngest graduate ever in Great Britain and Ireland. By the time he had received his doctorate he had distinguished himself in Greek and Latin, Hebrew, Sanskrit and Syriac, as well as in a number of modern languages and Irish. He began contributing to Blackwood's magazine in Edinburgh and in 1824 moved to London.
A writer of caustic, humorous satires his glory years came in the 1830s after his launching, with notorious bohemian Hugh Fraser, of Fraser's Magazine. Apart from his literary sketches for that magazine, he produced a ballad translation of Homer, translations of Roman comedy and what may be regarded as the first Irish short stories.
A well-liked, highly intelligent, but somewhat harum scarum character, he found himself eventually in debtors' prison. A year's sojourn there ruined his health and he died of tuberculosis in 1842.