You just need to put the commands in a script that runs on startup.
In 10.3, /System/Library/StartupItems/Network/Network seems to be where the system checks for the IPFORWARDING variable and such. It may not be advisable to muck with stuff from /System though, so you may want to put something similar in /System/Library.