Ditto on your experience Criendo. For all, if you didn't find it yet, here's the downgrade process from 4.0 to 3.1.3.
Takes a few steps & is FREE (no visit to the Apple Store). Follow closely, you can do it, just give yourself a little time. It doesn't require any "hacking," it's all just steps to let the phone find the correct local OS file (not the latest Apple Update one online) and then restore the info back to your phone.
For both PC and MAC:
http://lifehacker.com/5572003/how-to-downgrade-your-iphone-3g%5Bs%5D-from-ios-4- to-ios-313
Earlier today, I downgraded my 3G from 4.0 to 3.1.3 and it works just as before. Familiar icons, speed is back. Sluggishness of iPhone OS4 is not. Just pay attention to all the steps (and video) as there are unique .ipsw (restore) files for 3G versus the 3GS model, each of which are listed at that link.
Yes, for the record iOS 4 = POS