The Workflow sure works great for me, but I'm trying to understand your approach (and create other workflows on the same idea for other e-mail clients).
Why use a script at all? Can the same thing be done with a filter?
You can limit the scope to ~/Library/Mail/V2 and use the kMDItemAuthorEmailAddresses, kMDItemAuthors and kMDItemSubject metadata fields.
What's wrong with that approach?
I'm unsure how it all works, because I've ran into a few things I couldn't figure out when I tried (eg: using kMDItemContentType didn't seem to make any difference at all, that's why I eventually had to resort to limiting the scope).
Corentin