The problem is that you tried to use purplera1n to jailbreak a 3G. Purplera1n is a 3G[s] ONLY jailbreak tool.
You need to try to rejailbreak using redsn0w.
If there's a problem, you're going to have to upgrade his phone by connecting it to iTunes, upgrading to the official 3.1.2, then jailbreaking it with redsn0w.
IF YOURE ON A MAC, you can just simply use PwnageTool to create a custom firmware(operating system) that's ALREADY jailbroken, and easily unlocked.
It's late, and I'm not 100% sure on what to do, but what I said is a pretty good idea from what I remember. Just remember - if you have to upgrade officially through iTunes, you will NOT be able to unlock the phone to other carriers.
Wait for confirmation from other board member before you try anything. Just to make sure I told you the right stuff.