I'm not sure chickens could learn from a shocking device. Of course they'd know the thing on their leg was hurting them but I'm not so sure they could figure out why or how to avoid it. Chickens are smart as far as instincts, but I don't think they put things together in their mind like a dog does. There may be a few that can, but I don't think it's typical and it wouldn't be good for their heart if they got shocked over and over.
Also, I'm pretty sure no shock collars exist on the market for any animal under 10 lbs. As far as inventing one yourself, I doubt there is much information out there for how much voltage chickens/birds can take, not to mention the many sizes chickens come in. So how would you test the device without risking injuring or killing them. A bird's system is quite different than a mammal's, so you couldn't use calculations based on dog shock collars as a guide to how much electricity a chicken can take. And a little too much voltage could stop their heart. For me personally, using electricity on my chickens would be too risky an endeavor.
Maybe you could try some of those decorative fence sections that stick into the ground to make a nice looking perimeter. They come in different colors and pretty designs. I think it only comes in sizes up to 2 or 3 feet high, but it might deter them.