While trying to help someone over on another mac forum (because nobody else was offering anything useful to the topic originator) , I wrote my first useful Applescript (up until now, I'd modified existing scripts or done VERY basic things with it) and thought others here might find it of use.
What he was looking for:
"I have severals rules that detect Junk messages which are not caught by Mail.app built-in Junk filter. My rules move this to the Junk folder. However, Mail doesn't mark them as Junk (obviously, since I haven't found a way to tell Mail -> "Mark this as Junk"). This means I have to go to my Junk mailbox, and manually mark all these messages as Junk.

Any ideas on how to avoid doing this manually and tell Mail to mark something as Junk?

What I came up with:
tell application "Mail" to activate
tell application "System Events"
	keystroke "j" using {command down, shift down}
end tell
After your 'junk' rule criteria are met, this script will automagically "press" command-shift j - the Mail.app shortcut for selecting an item as junk mail.
Feel free to modify it, expand on it, etc.