There's no reason for you to upgrade iOS 4.0 to 4.0.1 unless you want to rectify the "Signal bars" issue (as claimed by Apple). And there's also no reason to upgrade from 4.0.1 to 4.0.2 unless you want to make your iPhone 3GS more secure from any attacks.
Anyway, if you still insist to upgrade to 4.0.2, you might want to read the article below:-
[Source] - Jailbreak iPhone 3GS on iOS 4.0.2 using PwnageTool [How To Guide]
However, take note its for the Old Bootrom iPhone 3GS.
The article also shows how to Unlock the iPhone 3GS on iOS 4.0.2.