First, we'll write an AppleScript to actually mount the Samba share. Start by running the Script Editor, and writing:
try
mount volume "smb://username:password@server_ip/share_name"
end try
Then, hit the Compile button. Assuming you got no errors, we're ready to save. Press File, Save As, and enter .mount as the filename (and make sure you are saving in your home directory). Choose Script as the file format, and then hit save. Now, we need a way to make this script run on boot/wakeup, if and only if we're on our home network. This requires an install of sleepwatcher, a great freeware utility.
Open the terminal, type nano -w ~/.wakeup and paste this text into the Terminal. As the script is written, it only mounts the volume if your computer's IP address's first two octets are 10.0.x.x. Feel free to modify to taste.
[robg adds: I haven't tested this one.]

