Ok, the past few comments have been a bit helpful. I would however ask that AWOL never comment on this forum question again, because he or she is blunt and not helpful.
The valves are Bi-stable, meaning they do have two relays that switch them. The relays shouldn't be powered continuously. Switching them off after a short while is the way to go.
There are four stable positions for the switch and I thought I'd look at millisecond speed at the values for the NPN end switches, and control the relays according to the positions of both cylinders, but even so still have them only move at a user command by a switch like this.

and only in a certain way.
When switch to 2 FROM position 1 I need my cylinders do something entirely different from when I switch to position 2 FROM position 3.
I use the end switches as a fail-safe because I don't want wrong moves to be made because of a situation wherein a user switches too fast from one side to the other and the cylinders haven't made their full stroke.
I really don't know how I should put these rules in a loop.
Even as a thing about the steps that must happen.
Maybe
Loop{
Look if the switch is on 1
If it is make a state change to 1
If it already was 1 do nothing
If the state was changed to 1 go see if analogRead Y reads more than three hundred
If it does move cylinder A IN
Look if the switch is on 2
If it is make a state change to 2
If it already was 2 do nothing
If the state was changed to 2 FROM 1 go see if analogRead X reads more than three hundred
If it does move cylinder A OUT
If the state was changed to 2 FROM 3 go see if analogRead Y reads more than three hundred, go see if analog Read X reads more than three hundred
If they do move Cylinder B IN
Look if the switch is on 3
If it is make a state change to 3
If it already was 3 do nothing
If the state was changed to 3 FROM 4 go see if analogRead Z reads more than three hundred
if it does move cylinder A OUT
If the state was changed to 3 FROM 2 go see if analogRead Y reads more than three hundred, go see if analog Read X reads more than three hundred
If they do move Cylinder B OUT
Look if the switch is on 4
If it is make a state change to 4
If it already was 4 do nothing
If the state was changed from 3 to 4 go see if analogRead Z reads more than three hundred
If it does move Cylinder A IN
loop}
subroutines
Cylinder A in:
digitalWrite 13 HIGH
Delay 50 miliseconds
digitalWrite 13 LOW
Cylinder B in:
digitalWrite 11 HIGH
Delay 50 miliseconds
digitalWrite 11 LOW
Cylinder A out:
digitalWrite 12 HIGH
Delay 50 miliseconds
digitalWrite 12 LOW
Cylinder B out:
digitalWrite 10 HIGH
Delay 50 miliseconds
digitalWrite 10 LOW
Even this method would not be foolproof but I'd get somewhere I think I'd be able to pick up from.