Posted two faster and less convoluted scripts as an edit to the post here.
I ran into the three reply limit on the forum (to prevent spam?) and I wasn’t sure if an edit would pop up on the radar, so I mention it here.
The last script again illustrates the creation of a prototype for imported Mail messages (it was easy). Still would have been very helpful to be able to create attributes via script. But the existing AppleScript implementation in Tinderbox is great, very speedy (well, at least speedy for AppleScript😀).