I have my female and male bettas in a divided 10 gallon. Their tanks were side by side for a while, so they could see each other. Neither of them flared at each other or tried to get into the other's tank. Not that they could, since the tanks had lids, but still.
When I put them in the tanks, I set up the tank first with the divider, gravel, heater, filter, plants and decorations. I made sure they had their own decorations to make them feel more at home in their new tank. I floated them both in their own sides of the tank and acclimated them, then released them both at the same time.
No one has tried or managed to get into the other half of the tank. Honestly, I don't think my female even knows he's there. My male flares at her sometimes when she comes near the divider, but she doesn't seem to notice him. If she does, I guess she simply doesn't care. They've been doing really well and neither seems to be stressed or anything. My male likes to fight the filter current and surf along the glass around the heater. My female likes to play with the plants and try to dig them up.
~ P o s e i d o n ~