OpenGL Code: Order of execution

I am trying to understand the order of execution of openGL commands(API’s). Are the commands executed as they appear in the code? For example if ‘glOrtho()’ is first and then 4 ‘glVertex()’ commands are issue, are these executed in sequence or the openGL pipeline orders these commands to make sense out of it. Please bear with me as i am new to openGL and is trying hard to understand things.

More or less yes.
Some commands that just sets a variable will of cause not take effect until a command that is dependent on this is called, though the variable will be changed when called.
So any changes to glNormal, glTexCoord and glColor does not take effect until glVertex or something that renders a polygon is called, this is actually true with most openGL calls.
The driver might do some internal restructuring, but this is only for performance reasons and should not impact the actual rendering.

This is also not something you have to bother yourself with.