Electrical junction box proximity
There is no issue there with crowding too many junction boxes into the space, it's fine.  

However, it looks like you have an issue securing the cables close to the boxes.  No trouble for the top box on each side, but how will you route the cables to the middle and bottom?  

The thing to do is add something in there to which you can secure the cables.  There are many things you could use, but 2x4 scraps are probably readily available and won't cost you a dime.  

You could cut three pieces of two by four to the width of the stud bay and nail it from stud to stud, standing on edge, at the back of the bay.  One would go above the top boxes, one between the top boxes and middle boxes, and one between the middle boxes and the bottom boxes.  (You might want to increase the space between boxes a bit just to make it easier to work around these.)  

Now you can route your cables vertically down the middle of the bay, and staple them to each 2x4.