Thanks for the link to the thread. It appears to be a more sophisticated approach (especially in terms of useful feedback to students, as you have outlined). But it will take some time for me to digest everything in that thread. For now, I am going to use the quick (albeit more rigid) approach above in an actual set problem (with unlimited attempts), and go through student past answers after the set is due to see how it works. Thanks also for the warning about domain change in "equivalent looking" expressions.
WeBWorK Problems
Disable/undefine functions/operators on only some parts of an answer
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 10 posting(s) in 1 day