By using the Simple Filter you can set your Action to execute its command when a device is added to a folder, removed from a folder, or both. For example:

By using the with a delay of option, you can delay the execution of your Action until a device has been in or out of the folder for a specified amount of time.