You don't need a script. Categories Hierarchy is a fork of phpBB version 2. I believe, and you would probably be better served by visiting the CH authors site, that you need to move all sub-forums away from being sub-forums first then run the convertor in phpBB3.
But like I said you would probably do better asking at the Author's site
Here's a topic
that discusses this very thing.