If you are regularly accessing storage variables in a function, it can save gas by just creating a new memory variable (on the stack), as calling the SLOAD opcode multiple times is very expensive.
Another example:
This was originally posted on my guide to saving gas on Solidity where you can find 20+ other optimizations for saving gas in the EVM/solidity code.