Thanks Mandy, this helped! I found my data file location and deleted it, so that all items became uncategorised again. Then I chose "Keep all uncategorised items". This let me still be able to see new uncategorised items as I acquire new things. Am running the script now - going letter by letter to properly categorise things, then running it as and when, it's amazing to see my inventory finally clean itself up! Appreciate your help, you don't know how long I've been wanting to use this script!
It should be at ~/Library/Application Support/KoLmafia
You might not be able to see Library, but you can get to it from the 'Go' menu in the Finder if you hold down Option, or you can use shift-command-G to use the 'Go to Folder…' command to get there.
Edit: I've put a copy of my data file at https://controlc.com/7491ad33 with everything changed to KEEP. You're welcome to use it, with the proviso that I *believe* I've changed everything to keep, but I'd suggest running it in simulate mode just to make sure. Also, part of the fun for me was running the script and seeing what new items I'd picked up from various places; having everything already listed means that won't happen.