This is probably more along the lines of what you were looking for.
Obviously this isn't tested, but I think it will work.
Code in words: Command the motor to the value found on Axis 1 (direction & magnitude) if either of the following conditions are met:
- Commanded to the right and the right switch isn't pressed
- Commanded to the left and the left switch isn't pressed
Again, I don't know which switches correlate to which directions on your stick, so the code may not work perfectly, TEST TEST TEST