If you had a different set of problems once it was repaired it suggests the issues are with the handset rather than the network. Did you purchase it from O2 or elsewhere ?
Have you tried a different handset to check where the issue might lie ?
A handset locked to O2 can be sorted, although O2 would be unimpressed were you to unlock it from their network. I'm unsure whether this voids the warranty with them, although it should still hold with Samsung. Did the shop say why they could not unlock it ? Was it that they didn't do that sort of thing, or that the hash codes were presently unknown. (It took me about 18 months to get my present phone unlocked because no one knew the codes !) If they are unknown trying on line isn't likely to help. If it is just the shop though, then you need to try another one. Worst comes to worst you could try O2 and paying back their subsidy to get it unlocked.
I'm surprised they say they can't do it anyway. One would have thought a company who got something locked would be able to reload the phone with an unlocked version of the operating system.
PUK codes are a different thing, they don't unlock phones.
Advice ? Difficult. It may be that your main issue is the reception, but this different set of problems after a repair makes me wonder. I think you need to get hold of an unlocked handset from a friend or someone to clarify where the issue is. It could, of course, be both handset and reception. If it is the handset you may be better off finding out where the Samsung service centre is and ask for help there. If it is reception, well that isn't going to change any time soon. Try a different shop for unlocking and ask for details why if they can't. If it gets unlocked you could invest in a different supplier's mobile service. If it can't be unlocked and does not appear to be a phone fault then worst comes to worse you can put this one away until they do work out how to unlock it, and invest in a different handset for now.