Simplest brute force method I would use would be to draw one set of alternating boxes exactly as you wish with border, spacing, coloring all established. You want to divide your map height and width to a nice number to create your grid spacing...Aesthetically you probably want the spacing to be an odd number vertically and horizontally so that your corners all look the same. Exactly what your example shows.
1. on a new layer make a rectangular selection which is the dimension of one grid box. Fill with white. Click the selection tool again and nudge it to the right so that the selection box is now flush to the right side of the white rectangle you just made. Fill with black.
2. Add details. I used a 1 pixel pencil and painted in the red and black lines - hold down the shift key to draw a straight line. Get as detailed as you want in this step but don't change the length of these two segements, the width of your map should be evenly divisible by these if you want the outline pattern to be semetrical.
3. Make your corners. Select your double segment, copy it and paste it. Go to Edit >Transform>Rotate 90 CCW. Align it so that its overlapping the right side of the original bar - make sure to copy your original layer at this point as well.
4. Use a one pixel pencil to repair where they overlap.
5. Place a corner piece in each corner of the map. Again your math should be good or this won't work cleanly. Use the same rotate trick as in step 3 for each corner.
6. Copy and paste in your sides from the original segment you drew. Try different layer overlay type to get different effects.
You can do a pattern fill for the black and white area as well, but this method lets you really add lots of individual details. It's very straightforward and only prone to issues if your math is off...its sometimes easier to make your border then scale your map to fit.
I like doing things this brute force way, I don't get lost in any trickery or smoke and mirrors. It's not very time consuming, in fact its quite fast considering other methods that would require more pattern set up and brush configuration.