Personally, I just started out by putting them in the pen first (they were indoors). After a few days, I opened the door and let them roam around a bit while I sat there. I would leave them out for longer and longer and they slowly broadened their range. I try to keep them in my yard, NOT in the neighbor's yard, but it doesn't always work that way. When I catch them over there, I spray them with the hose. It's bad enough that the BF's dog poops in his yard, I don't want my birds over there pooping yet too. Anyways, I check on them throughout the day, and put them to bed when the sun starts to go down. Get them into the habit and it shouldn't be too big of a deal to get them back into the pen. Someone posted a picture of something like 100 birds trying to get back into their barn. They were all just crowded around the door, waiting to be let in, lol.
ETA: Mine don't lay eggs yet. That's an adventure that I've yet to tackle.