For both your dilmnas, first to "unbrick" your phone
Since I haven't screwed locked a GSM phone, I would suggest these unbricking instructions for a completely smoked BB as if it was interrupted during an OS upgrade., Find the following Crackberry article
blackBerry 101: How to Reload the Operating System on a Nuked BlackBerry
To unlock a GSM BB, you may continue with unlock codes but another method and my preference is just reflash it using MML, it is found across the P2P networks and rapid sharing sites and will restore any USB connected BB to a factory and neutral carrier state.
There are loads of instructions across the web including countless forums to help the uninitiated in the event something fails. BE ADVISED, IF FLASHING DEVICES AND UPGRADING OS's IS SOMETHING YOU'RE FEARFUL OF THEN HIRE THAT SMART KID WHO USUALLY FIXES YOUR OTHER STUFF TO DO PERFORM THIS OPERATION.
Ensure you're PIM data is sync'd since flashing the phone for any reason including carrier neutralization also flushes your PIM.
MML and flashing doesn't apply to CDMA phones but the MML application is still useful for diagnosing any BB and also generating engineering menu unlock codes.