To make a procedure that draws a square:
Choose Variables/Make a block, enter a name and click on Motion:

Hover the mouse over the right hand end of the blue command and click on the orange + symbol to create an input parameter:

For the square we could use something like side or length for the parameter name.
You can now complete the code for the new command using the code sections as before.

The new command SQUARE appears in the Motion area that you specified earlier and it can now be run or incorporated into other Scratch programs.
Note that if you click on the Atomic option at the top of the edit screen the script will execute from start to finish without interruption by other scripts so it will run faster. When you have a lot of scripts running at once they appear to run in parallel because they are executed one line at a time in turn.
Write similar procedures to draw other shapes: triangle, hexagon, circle.
Write a procedure that draws a polygon of s sides. Get the input of the number of sides from the user (use Ask and Answer). It is probably best to have the procedure draw the shape only: keep input from the user separate e.g. under a green flag hat.
Write a procedure that takes two input parameters: the number of sides of a polygon and the length of the sides. The inputs to the procedure should be taken from the user and then passed to the procedure when it is called.