I found the best way to do it. With or without jailbreaking the iphone 3G.

What you need to do is restore to what ever version you like the best than after that cancel the first time Sync.

1) Uncheck the box under Summary Tab that is for auto connect to iphone and Sync.
2) Goto all other tabs and put your music, contacts, email account and all of that.
3) But in the Applications Tab Put Install NO APPS.
4) SYNC without apps
5) Than on the left side right click on the iphone 3g and click backup.
6) Let it backup. (It should take about 5 sec)
7) Than this is the good part. To get it to reboot okay every time.
8) Goto Apps tab but this time put select apps and deselect them all.
9) Than when you want select the first one and Install one at a time.

NOTE VERY IMPORTANT. I know this takes a lot of time but also. After you still the first app look at the iphone 3g and at the top you will see like a circle working. Let it finish and than select the next app in itunes and put apply. And than again wait until the circle finishs and repeat until all apps are installed and you can do a couple of restarts after this and you will see it works like a charm. I think the problem is not that there are more than 40 apps. I think the problem is Syncing all apps at a time does not let them install right and than when you restart or reboot it freezes hard time. So take my guild and use it well.

URGENT: Also to upgrade apps uninstall the upgradable app first than upgrade it and goto the itunes applications folder and delete the file the says *****.ipa and rename the one that says ****** 1.ipa and rename it to normal name.ipa okay than copy it to the itunes and sync only one at a time again please. Also for uninstall one at a time. I know it is a pain in the a55 but at the end. You will have fun without restoring again.