You can use "timer 1 0 command", which does it outside the command, after zero ms delay. If you needed $nick you'd need to pass that as a parameter.
The default for $encode/$decode is switch u UUencode, but that includes commas and dollars. You should change both (%password) to (%password,m) to use base64 (or switch a for base32).
Or use $unsafe to prevent it being evaluated.