You can't use the above code directly for what you're trying to do (unless you're trying to completely replicate the AdminCP interface or similar). It's up to you to adapt it to your needs, I'm not going to do that for you. I don't code plugin requests, neither do I code plugins or most of a plugin for someone. I'm willing to give advice, explain concepts, or find faults, but I'm generally not going to actually do any coding work (beyond demonstrating principles).
If you're struggling to understand such a piece of code, I strongly suggest trying to understand PHP more thoroughly. Otherwise, you're just going to keep having issues, and you're going to keep asking, and it's not going to be beneficial to anyone.
Randomly selecting a name is easy if you don't mind it being truly random (ie, possible for the same name to be picked more than once).
If you want random elements to be never be picked twice, across multiple calls, you'll need some persistence, such as storing the array somewhere and removing chosen elements when you pick them.
You could set up an array of arrays containing the user data you want, then your code will pick one of these arrays, and send it directly to the userhandler. This is probably one of the easier aspects for MyBB as well...
Hope that helps.