Cast mage hand use the fly command to fly over the gate and to the other side then you can use the lever to open the gate!