Ex:
AdditionRule (x :: NumericExpr) + (y :: NumericExpr) = eval(x) + eval(y)
It's been a while but I also remember seeing a concise DSL for tree rewriting in the ATLR compiler. It also had escape hatches for things like context and precedence calculations.
In terms of GUI and clicking, I think it might need to be more sophisticated than that.
What does clicking mean when you are a clicking on a sum type? Is it just that variant of the ADT, the entire type?
What about for complex expressions? Are you selecting just a term in that complex expression or the entire expression?
I suppose if you were looking at a tree visually then you could select a lot easier.
Seeing how other languages do "destructuring" or "pattern matching" might provide other possible alternatives.