I'd like to create a rounded rectangle that's cut evenly in half with the flat edge in the middle left open (#4). Once I created my rectangle using the rounded rectangle tool I created a line using the line segment tool in order to divide it in half (#1). Then I'll select both the line segment and the rounded rectangle and use the pathfinder divide tool. This causes the space in between to be filled with a black line (#2). Once the two halves are ungrouped the solid black line stays as part of the individual shapes (#3).
Then choose the scissors tool (keyboard shortcut is c) and click on the middle top point and the middle bottom point. This will "cut" the path at those 2 points.
Then simply move the paths apart and you will have what you show in your image # 4.