This script randomizes a MAC address--but I cannot renew DHCP afterwards
If you're on MacOSX 10.5 or later, at the beginning of your script, call sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z. Another thing you could do to improve this is to call the script itself with sudo instead of calling sudo multiple times within.