frankly I am baffled - this sort of thing use to mess with our tutors head. More than three and she'd panic :-)
But hopefully what follows may help.
Question 1.
If you are only moving through the one array why use a multidimensioned array?
by fixing 3 elements your are creating a 1 dimensioned array!!!
Question 2.
is it possible to swap the element $x and [5] around?
a posible solution is to have many arrays. i.e. one for each fourth dimension. after all a four dimension array is just an array that stores many 3 dimension arrays.
i.e. array1[$i][$o][$x] = $myarray[$i][$o][$x][1]
etc.
then you can happly count ($array5[0][0]) for you for loop.
hope some of this helps.
Ian