These are not precise instructions, just a hint for a successful jailbreak and unlock for 3GS.
it worked on iPhone 3GS 3.1.2 with 05.11.07 modem firmware
1) restore from original Apple firmware :
2) then activate with a official carriers SIMcard
3) do the Spirit magic (http://spiritjb.com/)
4) install ultrasn0w using Cydia
5) if stuck on "searching..." "no service" add http://cydia.pushfix.info/ source to Cydia and install "blacksn0w RC2 Final".
That did the trick.