When buying a frame I wouldn't pay significantly more for a respray than for the same model with paint that requires touch up to be presentable (a 5 footer). That is typically far less than a frame with nice paint. Considering a quality respray costs as much as many really nice frames, it's poor from an investment sake if you want to sell to me. As mentioned, resprays can hide repairs, but I'm usually not in the market for frames that are considered worth repairing from a value perspective. Sometimes you have little point of reference for determining if something has an older respray, such as with custom frames or limited run team frames.
It does seem that the older the bike the more I'm willing to put up with in terms of paint condition before a respray, but that is partly due to those bikes being fair weather riders. All that said, spray bomb bikes are sometimes very nice frames hidden under hasty resprays (those can sometimes be great riders, but again i wouldn't put much $ into the frame itself initially)
When considering a respray on a bike I've owned for a long time, I first consider if keeping the original paint will enhance the value (to me) more than I would enjoy the extended life and better looks of the respray. I find that touch up can do a lot to maintain a frame (especially the braze ons). It takes a lot of neglect and/or time to be concerned about rust to the point in becomes a safety or ride quality issue. My most used riders will see an OA bath, touch up, and rebuild about every 3 years (if needed), and I consider it unlikely that rust will cause much structural damage in a 3 year window if a bike isn't often put away wet/dirty, and cleaned soon after. I would never respray a frame as in investment, except possibly for rattle canning a less expensive single speed (and then I know I'm not being paid for my time).