From the code perspective, this looks correct. From understanding your code behaviour, you are update the state of the animation's "Block" value when the user is holding the mouse down or not.
The problem appears to be in your Animator's controller; without further context on what your animation tree looks like, and any parameters you have setup, it will be difficult to answer this question correctly.
My advice would be to check whether there's a condition assigned to your animation clip tree.