Servos are precise motors that you can make rotate in predictable ways.
First click on the blue cog on the start block and tick the checkbox next to extension pins input/output.
Click the cog again to close this window.
Select digital output from the leg 6 as dropdown menu on the start block.
This puts leg 6 into the servo output mode.
From the Servo menu, drag in two set servo blocks and snap them inside your repeat while true loop.
From the Basics menu, drag in two pause blocks and snap one below each of your set servo blocks.
Click on the leg number of your set servo blocks and change them to 6.
Click on the number block inside the position block of your first set servo block and change the number to 0.
Click on the number block inside the position block of your second set servo block and change the number to 255.
This will code will move the servo one way, wait a second and move the servo back again. It will repeat this again and again.