Assuming you have an Intel iMac which is needed in order to upgrade to Snow Leopard, if you install the Snow Leopard upgrade it does not come with iLife. In order to get iLife, you would either have to purchase the full boxed version of Snow Leopard or download iLife from the App store after upgrading to Snow Leopard 10.6.6 or higher.
I'm not certain Garage Band 3 will work with the latest version of Snow Leopard. However, since your iMac is a 2006 model, it's likely running Tiger. In order to upgrade from Tiger to Snow Leopard, you'll have to do a clean install. That means you'll lose everything unless you back it up first to an external hard drive. If you're currently running Leopard, the Snow Leopard upgrade will work and will not remove or overwrite your Garage Band files.
The bottom line here is that you should back up everything anyway before doing an OS X upgrade.