Well, to use that code, first you would have to have both your WP and Drupal databases on the same MySQL server.
Now, that's not hard to do if they aren't already. You can just dump your Drupal database to a text file, copy the text file to the machine with the WP database, and then import all that data into the same MySQL server. So long as your database NAMES are not the same, there won't be a conflict.
How you do the dump and import depends on what kind of access you have to your MySQL databases. I would much prefer to do this via a MySQL command line interface. But if you are on a shared server, that may not be an option for you. So try to find out what tools are available on your server (hopefully, at a minimum, phpmyqladmin?) and find out how to do those steps using your tools.
Once you have done that, you just run that query he shows you.
His documentation is slightly wrong. He says
Here’s the script. “wp” is the name of the wordpress database and “drupal” is the name of the drupal database.
In actuality, in that script the name of his wordpress database is wp23
as you can see from reading it.
CAUTION: That code is OLD! See the date on it? April of 2008. It is QUITE POSSIBLE that both Drupal and WordPress have changed their DB schemas by now. So before you run it, check both databases and make sure that all the field names he uses there exist in the tables he shows there.