Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
so once you unlock the phone is it unlocked for good or if you do a restore is it locked again?

When you software unlock any iphone by Jailbreaking and unlocking it will always lock again to its official carrier if you restore or update it to official carrier.
You should never update a JB and unlocked iphone unless you know what you're doing or else you'd be stuck with no unlock and maybe no JB options.
 
A software unlock, e.g. ultrasn0w is lost when you restore.
A factory unlock, set by the official network provider, stays when you restore
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.