Copy and paste the script into Script Editor, and save the script. Here's how to use it:
- Select a message in Mail.app.
- Call this script (either via the Script menu, or via a hotkey...)
- Choose a name for the folder in which you want to keep messages from this sender
- Move any message from the sender you wish to filter into any folder.
- Select this message.
- Call the script.
- The script realizes that we are in a folder which is not the In Box. It then gives you the choice to use the current folder, or to use another one.

