Here's what I suggest:
Post a new question in the BASH scripting section, ask for a way to add users with "smbpasswd -a -s".
With the -s (silent) option, there's no text echoed to the screen, so all you need to do is to echo the password twice.
My problem is that I don't know enough about bash scripting to do this.
But I suspect it's probably suprisingly easy...