Remote Training script and telling SpamSieve to use iCloud's Junk mailbox

This help page describes how to tell SpamSieve to use the iCloud Junk mailbox:
http://c-command.com/spamsieve/help/consolidating-spam-from

Is it possible to do this with the Remote Training script, when you also have other multiple standard IMAP accounts using a mailbox called Spam?

The only way I can think it would work is to change the script to read:
"property pSpamMailboxName : “Junk”

And then SpamSieve rules to point to Mail.app’s Junk mailboxes (which already exist in my case).

Is this the right approach?

The Remote Training script will use the same mailbox name for all the accounts. However, you could run two instances of the script, one configured with certain accounts and pSpamMailboxName “Junk” and one configured with other accounts and “Spam”. And then follow Separate Spam Mailboxes for Each Account.