This very same question has been asked frequently. But I am afraid that the answer is still negative, that is, no one except Pentax knows how to do it up till now, and there is no leak so far. However, many K-5 and K-r users still ask for the solution from time to time, here are two examples:-
For the K-5: http://www.pentaxforums.com/forums/pentax-k-5-forum/123205-pentax-k-5-debug-mode.html
For the K-r: http://www.pentaxforums.com/forums/pentax-k-r-forum/145929-excuse-me-did-research-debug-mode-penta-k-r-come-out-thank.html
In fact, since the "modset" file extension numbers for the K-5 and K-r in entering the debug mode were discovered, people have tried almost all the possible combinations of tricks such as SD card door opening/closing, pressing of different buttons while booting up and etc., but their efforts were all in vain.
In particular, the second OP who asked for the K-r debug mode entering method had actually tried the file extension from 000 to 999 and played with all tricks but he was yet unsuccessful. So, he registered at the PentaxForums and wrote his first post, but very shortly afterwards, he was banned! (Actually it should use the word *prosecuted* to describe!) >:-[
People were then asking why but no Mod nor Admin of the PF nor the site owner Adam answered the question! :-o
That's just ridiculous afterall. But anyway, I think I should thank Adam for letting a Blog link of mine remains in that post, unlike for a previous certain long period that when any member of the PF posted any of my links, they had to be removed almost immediately. Thank you, Adam! ;-D
So, back to the question for why debug mode for K-5 and K-r is still required. It is just because the built-in "AF Fine Adjustment" is simply inadequate for many cases and those affected K-5 and K-r users did and do want to have more, so as to correct the large AF errors of their bodies which are surely yet highly undesirable.
Related:-
K-x Debug Mode Tutorial - AF Adjustment
Important K-7 Debug Mode Activation Note
K-m Debug Mode Unleashed! (For AF Correction)
K10D Firmware 1.3 Debug Mode Unleashed
Stupid Censorship and Means of the PentaxForums (and the Dictatorship plus Hypocrisy Behind)
URL Blocking War Between DPR and PentaxForums