Here’s the script modification I made at the time. It’s a mess though, my database was like the creature of Frankenstein, and many lines are commented out from testing stuff, it’s not meant to be used as it is:
Look at def import_pm for the part that interest you.
And don’t forget:
Good luck !
Also I strongly suggest you that you compare the content with the official importer so you can see exactly what changed.