You don't need to sell it. I believe what has been done to your phone is not a untethered JB and hence you need to Jailbreak and Unlock it every time you reboot the device. This guide below should help you How to Jailbreak/Unlock 3.1.3 iPhone 3GS/3G/2G iPod Touch 2G/1G with sn0wbreeze Windows This should work because you're on 3.1.2.
iClarrified has released a guide to upgrade to JB & Unlock OS 4.0 but not confirmation yet.
Teky,
Any more latest update on the new JB untethered on IOS4.0 ?
Kittu