One of the important things to consider would be the center of gravity of the expanding wall.
In your design, when you expand, everything moves up and, therefore, it will require extra force from the motor. When you retract the wall, COG moves down making it easier on the motor.
You can use strategically placed rubber bands to counteract the force of gravity for the most part or attach the motors to the top bar.
Finally, as an alternative, you can take a look at one of the linkages from TEN FOLD Engineering that were optimized for horizontal expansion:
As for the gear ratio, you have to try it first and then adjust if nesessary.