If anyone from my old job reads this I'm going to get hate emails for days... but my catch phrase is modularisation! I'm sorry, had to say it.
that means break it down, keep it simple. And if involves a rewrite then do it, because you'll have to maintain it one day and think what that'll be like. If it makes your head spin now when you're familiar with it, think about when you come in cold.
The java guys say that if code is more than one screens worth then you need to break it down to a separate method (ie function). Bit extreme but they have a point.
There must be code which you are repeating. Should you have a function to do the job?
you might want to put the building blocks into variables to be called later. You might want to use templates. There's a reason why they are so popular.
sorry, I can't give you better news that this but...