For stand alone games, the basic game loop is (source: wikipedia)
while( user doesn\'t exit )
check for user input
run AI
move enemies
resolve collisions
A very useful and I would argue pertinent paper to read is this one: Client-Server Architectures
I gave it a read and learned a lot from it, a lot of sense was made. By separating out your game into strategically defined components or layers, you can create a more maintainable architecture. The program is easier to code, and more robust than a conventional linear program model like the one you've described.
That thought process came out in a previous post here about using a "Shared Memory" to talk between different parts of the program, and so overcoming the limitations of having a single thread and step-followed-step game logic.
You can spend months working on the perfect architecture and program flow, read a single paper and realise you've been barking up the wrong tree.
tldr; read it.