Does changing the order of the steps within a round affect the security of AES? I was trying to understand the internal structure of AES (Advanced Encryption Standard)

The Standard order of steps within a round:


Substitute Bytes
Shift Rows
Mix Columns
Add Round Key


Substitute Bytes, Shift Rows &amp; Mix Columns satisfies the two most important properties required for a secure cipher i.e confusion and diffusion 

Substitute Bytes provides Confusion i.e. that each binary digit (bit) of the ciphertext should depend on several parts of the key.

Shift Rows along with Mix Column provides Diffusion i.e. if we change a single bit of the plaintext, then (statistically) half of the bits in the ciphertext should change

Changing the order of Step 1 and Step 2 won't have any effect. But to what extent can we change the order of other steps? Does it weakens the security of AES, and if so, how?
Short answer

Changing the order of the operations does not weaken the security of $\mathop{AES}$ (nor does it increases it).

Long answer

Remark: While ShiftRows and SubBytes are commutative ($f\ g : A \rightarrow A,\ f \circ g = g \circ f$). They are not commutative MixColumns. Therefore changing the order of operations will not produce the same result. But this is not relevant because we are looking from the security point of view.

The order of the operations inside the round function does not matter. This can be shown by observing the propagation of the byte dependence over 2 application of the round function. 



In this analysis I'm ignoring the key addition because this operation can be placed anywhere in between all the operations given some tweaking. Thus we can see that the diffusion of a difference is the same as the one in the original specifications. The main reason of this result is due to the strong alignment in Rijndael.

Also this is further explained in Chapter 3 and 5 of The Design of Rijndael by their implementors.