Avoiding the previously described pitfalls can be challenging because most of them ease our greatest pressure; lack of time. Here are some good habits that you can try to work into your development process that will help guide you away from the bad habits we've already talked about.
Writing down the details of what you're trying to develop is one of the first steps in avoiding many development problems altogether. When you write it down, you're forced to put all of the details about your project in one place. This is important when we think about a development project because our thoughts are often fragmented, focusing on specific components one at a time.
Writing your thoughts down will help put everything in perspective, organize the various components of the project and allow you to break up the project into smaller modules if necessary.
Now that you've written the ideas and thoughts behind the development project down, you need to go into more detail. Write down all the specifics you can possibly think of. When you've written so much that you're sick of it and don't want to write anymore, you're about halfway there so keep going.
Think about how your tool could be re-used in your work life. Not all tools you'll develop can or should be re-used, but if there is an opportunity to generalize something, put in the extra time.
Over time, you're going to need to make changes or update some of your tools. If you are consistent in your development language, style, naming conventions, etc... you will have much easier time understanding something you wrote a long time ago. This becomes a factor when you need to make a single minor edit that ends up being somewhere in the middle of the code. If the code looks familiar to you, you'll find things much faster.
Documenting your code is important. You'll hear this in any programming class you take, read it in any programming book you read and learn it in any programming project you maintain. If you're developing tools for yourself, there's more freedom for personal style in your documentation, possibly omitting things that you would otherwise include if you were developing for something else. Do whatever works for you, but keep in mind that the more detail you have in your documentation, the easier a time you will have later on when you need to fix something.
So why doesn't everyone do this? Why don't I always do this? Well, these things require three things that are difficult to commit. They require considerable thought, more work and more time. The payoff is also long term, and most of us have a hard time investing resources into things that will only payout over the long haul.
Building things that don't break is a challenge, but the rewards are great. You'll have dependable tools that you will use to help you do your work more efficiently. If you do these things right, you can work your way towards a situation where you will spend as little as 15 minutes a day or less doing technical maintenance for your website. This will buy you more time over the long haul to work on the more important parts of your website such as content development, link building, advertising campaigns or any number of other things that you think will best improve your site.