I thought I’d also report that I regularly use the script you linked to above – from Korm’s 7/10/2013 post here – and which you said was giving you an error.
I have Hazel watch a folder (into which I have Keyboard Maestro drop text files as part of a complicated PDF note-taking workflow, that I may describe on these forums someday…). Hazel then runs the script, via this rule that is probably so simple it’s not worth posting a picture of:
I just tried dropping an email from macOS Mail into this folder, and that got imported no problem to the specified group in DTPO.
So … all is good on this computer … sorry that’s probably not much help to you!
P.S. to Korm: Please don’t delete that post like you warned you would! It was super useful to me. Thanks for that, and for the many other tips you’ve provided on these forums.