this thread will show you how to "back up" your firmware version with the baseband in case you accidentally update and need to downgrade again. Do it before the update because Apple will stop signing the OS 4.0 as valid.
Everything else is basically have a backup of your music, pics, etc.. on your computer by sync thru itunes or getting into your file-system while jailbroken using
this thread in the "SSH" section.
If you ever find yourself needing to "reflash stock" you just download the iOS 4 IPSW file found in the above thread and restore it using itunes, just hold shift and click "restore" locate your IPSW and you will reflash the stock iOS 4 OS, then you can jailbreak again, etc..
note currently there is no JB for iOS 4.0 on the iPhone 3GS.