Those verses were probably made up by Donald McCormick in the late 1950s. I believe that doggerel first appears in his book The Identity of Jack the Ripper.
Quite right Sam, I've found them in McCormick's book The Identity of Jack the Ripper.
He qualifies the final verse as being attributed to McNaughten's memoirs, however there is no reference to the source of the two other verses unfortunately ;-(
‘There is nothing more deceptive than an obvious fact’ Sherlock Holmes