Do what you feel is right in the situation; I'm not sure if a general policy is possible here (or at least I don't know what it might look like.) I might just point out that answers on closed questions aren't always entirely unhelpful, right? They can help provide us possible components or elements of a new or reformulated question that might be less borderline.
What I would really try to resist would be pouring a lot of valuable time/energy into a contribution that responds to a version of a question that you know isn't in "good-enough shape yet" without substantial revision.
On the one hand, you risk having to revise (and potentially discard) some of the content if the question is updated; or on the other hand, having poured that energy into an answer to a question that's just going to remain closed. Again, it can help provide some guideposts to future readers or editors that might have a similar concern or want to provide a canonical question -- so the work you've done might have helped provide some background structure to possible new questions -- but I might just keep in mind this isn't nearly as useful as a high-signal answer to a high-signal question.
A few more thoughts in passing. I feel like in a way some of this might speak to your other recent questions about over-eager closing and close-voting versus down-voting. Instead of encouraging more aggressive editing, I would encourage more frequent asking -- giving better examples of what great questions look and feel like. I think this might be the thing that's missing -- really deep engagement with the question side of the platform from the "leaders" of the community. I'm not sure there's a great solution here other than to strongly encourage everyone to continue both voting and asking (early and often...)
However, a few things do occur here that we've tried to roll out in one form or another: organizing reading/analysis chats (that could help drive question-generation), contests for great questions (that might lure higher-rep users into setting better examples), more intense editing-drives where we go deep-diving on questions trying to cleanup things -- identifying questions where several different concerns are conflated, maybe splitting these apart into several distinct questions, in addition to normal cleanup like throwing flags or down/closevotes on things that look problematic, etc.