don't mean to commit necromancy on this one but I went for a pretty simple solution for this problem in mounting my smb shares through scripts under kubuntu 8.04 as I was having the same original problem (no messing with wins, config files, etc.)

I just started using something like this in my scripts...

IPADDRESS=`nmblookup hostname | tail -n 1 | sed 's/\(.*\..*.\.*.\.*\) .*/\1/'`
sudo mount -t smbfs //$IPADDRESS/share /path/to/mount/target -o workgroup=WORKGROUP,username=username

this prompts for a password for protected shares but you can figure out how to put that on the command line (I like to be prompted as opposed to putting passwords in scripts).