Personally, I would recommend using the state machine in code, especially if you already have a working state machine. To the best of my knowledge, the AnimationTree is just a state machine with some additional code for blending animations, so just using the AnimationPlayer directly will probably work. The only thing that may not work as well is blending more than two animations at a time, as I believe $AnimationPlayer.play
can only blend a single animation, but that is really the only downside I can see.