When you are mining, like cooking, there are breaks in animations while you are still mining.
If you are only using isAnimating, then even though you are still mining, there will be a split second where isAnimating will return false, i.e. a break in the animation.
Even though your player will continue mining after that split second break, the script will only know that the player is not animating, and it will try to interact again.
You need to have some tracker to see how long you have been idle for.
For example, only interact if you are idle for > 300 ms.
Then if a animation break last 100 ms, the animation break will not trigger another interaction.
If that makes sense.