One way you could do it:
1. Make a continuous path of the outline, so the ends of the sidelines are connected to the adjacent end of the top or bottom lines.
2. Make a layer filled with black. Select the path and fill with white. (If the path corners weren't connected you may not get the right selection).
3. Make the lines as a second path.
4. Stroke the lines path in black, I used line width 2.
5. If you want the final selection, copy the black and white result into a channel or a layer mask. Make a selection from that channel or layer mask.
1. Make a continuous path of the outline, so the ends of the sidelines are connected to the adjacent end of the top or bottom lines.
2. Make a layer filled with black. Select the path and fill with white. (If the path corners weren't connected you may not get the right selection).
3. Make the lines as a second path.
4. Stroke the lines path in black, I used line width 2.
5. If you want the final selection, copy the black and white result into a channel or a layer mask. Make a selection from that channel or layer mask.