The problem is most like the value of $username. Since it is an unquoted variable, the shell will interpret special characters. This can cause problems. For example, if the last character of the username happens to be a semi-colon (

that is the command separator for most shells and it would see PasswordSet as the name of a new command. There are other characters than could cause problems, too.
In shell scripts, you should almost always quote the use of variables in order to hide/protect special characters, especially in situations like this where it is a simple value substitution. Change the command line to:
/sbin/e-smith/db accounts setprop "$username" PasswordSet yes
and your problem will likely disappear.