It can take a while for hens to get the hang of roosting where you want them to. It depends also on where they've been kept previously - eg. if they've been in a probably won't be used to going into a little shed. Just keep putting them inside in the evening. I have a hen house with a ladder, and door about 4' up. Some figure it out straight away, those that don't, I like to catch them before it's too dark and half holding them, encourage them up the ladder and through the hole, they normally get it pretty quickly.
Don't know about electric fence sorry.