Leg locks work good if you are better at them then the other guy. If you know equally much or close, then sometimes you will get into 50/50 situations and you might be the one to get leg-locked.
They are all about the right set-up, and quickly giving up in favor of a quick scramble for better potsition though. I think the basic rule of leg-locks should be that if you can't slap them on quick then it's best to use them to set up a guard pass or scramble to a favorable position.
And yes, sometimes you will get punched in the dome a few times, but once again, you are probably taking too long if that is happening.