It's partly a trade off between difficult to read code (highly optimized assembly) and executable size. Some old console games actually employed self modifying code not for obfuscation, but size.
The most complicated example I've seen thus far, however, is that of Crash Bandicoot for the PS1.[2] Perhaps the most interesting thing is the description of their efficient code use:
"Ultimately Crash fit into the PS1's memory with 4 bytes to spare. Yes, 4 bytes out of 2097152. Good times." (3)
[1] - http://www.rantgamer.com/wp-content/uploads/2014/12/Clouds-a... [2] - http://all-things-andy-gavin.com/2011/02/02/making-crash-ban... [3] - https://www.quora.com/How-did-game-developers-pack-entire-ga...