It pays to think about SEO when first building your site so as to avoid the pain of having to fix things later. However, none of us ever get things 100% right from the get-go and optimization changes are always in the cards. What's important to keep in mind is that if you're going to be changing a large number of pages or changing important elements of pages (e.g., title tags or URLs), is to roll out the changes slowly if possible. Search engines will often notice large-scale changes, and raise red flags if they think you're over-optimizing. As a rule of thumb, if you're changing more than 10,000 pages, try to roll things out in smaller chunks (perhaps 10-20% chunks) and give the engines time to digest things and adjust rankings. That way you can see what the expected outcome might be and continue with the changes if things look ok.
Some time ago I changed around 100,000 pages at once - both the title tags and meta descriptions only to see a fairly rapid drop in the search traffic they drew. The changes were all for the better, but the magnitude of pages changed at once probably drew attention from the search engines. After 6 weeks the traffic bounced back (and higher than before as we had hoped), most likely as the engines noticed that the pages had stabilized and indexed them properly again. In all likelihood had I changed the pages in 10k page chunks, that would have avoided the temporary search engine penalty / sandboxing (and a whole lot of grief and nervousness hoping that the traffic would bounce back!).