How to ask for a mail folder in applescript?
While I don't know if AppleScript can do what you want, there is an Apple Mail plug-in called Mail Hub that will do what you want as well as add additional functionality. I'm a satisfied customer.