(1) the more straightforward (but less powerful) option is to use the dynamic bounds for a slider. Here, "a" is set to animate, but the bounds don't let it move if b=0: https://www.desmos.com/calculator/mqhhpso67r
(2) the more general feature that allows for complex scripting behavior is called "actions." Here's an example that uses that, where it's more of a genuine play/pause: https://www.desmos.com/calculator/gzqwx36lo0