If the script and rule are set up properly, you should never have to use Apply Rules. It will automatically clean out the Junk mailbox whenever you receive new a message in the inbox. You can test that the script works by running it in Script Editor and checking for errors in Console.