I know your problem, everything has to be perfect. But of course, everybody knows, that there are a lot of possibilities how to write code and it can be done better or worse. Many time we see the better opportunity after some time, when we have already done it, when we have to implement something new to it. But that is normal. Therefore re-factoring exists ;)
Try to believe more in yourself, that you are writing good code. First, make good analysis of work you have to do, to see as much connections as possible, and then improve your skills by studying code writing rules, new techniques and various practices, where you will learn how to code better.
When you find some bug, it is good to check all places, where can be the same problem.
But normally, when you don't find any problem, don't bother yourself be scanning already done work and continue coding. You will find those problems after some time and then you will know what to do.
It is good practice to write down all issues you want to check, implement, or fix. In some moments, when you are doing something else, you will get a good idea, what to check or do, so write it down and then do that. In this way you will fix a lot of problems and you won't stay in one place by finding some problems, because you "feel" there must be something wrong.
So don't try to have everything perfect, just start to work in the best way you can!
These your attributes - to check everything, to have everything perfect - are great attributes of testers. It is their responsibility to find every problem, to test every feature in all ways and try to have everything perfect. Maybe you can try this kind of position and be satisfied with your habits...