All you need to do is pass the account, old password, and new password to your script as parameters. You don't need to do a find command.
The error is the clue. Your problem is coming from trying to use global fields to pass the username and password to the script. I believe if you pass your parameters in as script parameters rather than relying on global fields, you'll have better luck.
Thank you! Mark, and Mike.