It is possible to some extent by using custom code, and people have done so.
However, there is quite a bit of subtlety to the problem and our best understanding is that we cannot presently add a feature that would work reasonably well in a reasonable variety of cases. (If we did, we would have done so already, of course; it is a very common feature request.) As one starting point, consider that the Z stage cannot (in general) be moved in sync with X and Y for the simple reason that its speed does not (in general) match that of X and Y motion. As another, consider that there isn’t really straightforward graphical method for varying the color of a path within SVG.
Obviously, if you’re working one particular use case, that’s an entirely different matter. It’s a fair bit of work even for a specialized case, and so we don’t generally advertise it as a capability.
Finally, you might be aware that we *are* working towards a future solution for variable pen height. Our efforts on this topic are directed there, instead.