I've seen similar hints for this before, but none worked when a message was open in a window, rather than when using the Preview pane. I hate working with the Preview pane, so this was preventing me from using those hints.
However, by modifying others' AppleScripts, I came up with the following, which closes the current message window, then opens the next unread message:
tell application "Mail" to try
tell window 1 to close
tell message viewer 1 to set selected messages to {first message of beginning of (get selected mailboxes) whose read status is false}
tell message viewer 1 to open selected messages
on error
beep
end tryMac OS X Hints
http://hints.macworld.com/article.php?story=20100109190959736