I guess that the best method is knowing that you have to finish the job, even if you have to do it all again , and again. Am I talking about being paid?
So, when you are sure that you are going to finish it. You start thinking ahead.
Your structure is going to appear after thinking about the piles of data that you are going to collect before starting the code.
Then, even when you are actually structuring everything, you keep on fearing that all your good code is not going to take you through the easy way to the end. So, you start asking someone that might have done something similar. There comes the different ways of approaching your analysis.
The conservative way is getting the most close to your way of working. The most innovative one is tryied when you start getting tired of your daily routine. More or less...