I also find myself to have too much to defend and too little ships to do it effectively.
Since I usually role-play my government to be based on humanistic/democratic ideas I must insure as much safety to all my colonies with priority to those with populations on them.
I will scrap ships when they simply are too costly to refit or they are above fifty years old and arrive at their next overhaul. Basically a role-playing thing where I expect a ship to start beginning to become too expensive to maintain due to old age and strain on the superstructure of the ship.
This will make sure I use as much of all my ships as I can for as long as I can. Having ships around for about fifty years will usually give me a good chunk of old outdated ships with some modern systems on them. These are used to patrol less threatened areas and/or act as a strategic reserve, these ships also tend to be quite cheap to maintain in comparison with newer ships so maintenance cost should not be much of a problem.
I will, though, scrap ships after a major war if that war drags on for an extended period. I usually cap my expenditure on fleet construction/maintenance during peacetime to a relatively low value. But again, this is mainly for role-play purposes and will depend highly on the political climate that the federation is facing at any given time.
Although, i do agree that ships should be able to be mothballed. In reality space is the ideal place for storing something for extended periods without succumbing to deteriorating conditions of an atmosphere and/or gravitational forces. As long as it takes some considerable amount of time to get them to operational status for game balance sake I would be all for it.