Why does it sometimes keep restarting/playing the animation?

UserInputService.InputBegan:Connect(function(input, gpe)
    if input.KeyCode == Enum.KeyCode.G and game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Health ~= 0 then
        if gpe then return end

        print("Parade1")
        for i,v in pairs(game.Players.LocalPlayer.Character.Humanoid:GetPlayingAnimationTracks()) do
            if v.Animation.AnimationId == "rbxassetid://10093610717"  then
                for i,v in pairs(game.Players.LocalPlayer.Character.Humanoid:GetPlayingAnimationTracks()) do
                    if v.Animation.AnimationId == "rbxassetid://10093610717" or v.Animation.AnimationId == "rbxassetid://10093808133" or v.Animation.AnimationId == "rbxassetid://10093775175"  then
                        v:Stop()
                    end
                end
            else

                for i,v in pairs(game.Players.LocalPlayer.Character.Humanoid:GetPlayingAnimationTracks()) do
                    if v.Animation.AnimationId == "rbxassetid://10093610717" or v.Animation.AnimationId == "rbxassetid://10093808133" or v.Animation.AnimationId == "rbxassetid://10093775175"  then
                        v:Stop()
                    end
                end
                game.Players.LocalPlayer.Character.Humanoid.Animator:LoadAnimation(script.Parent.Animation.Parade1):Play()

            end
        end
    end
end)``` I have made it so you can stop the anim by pressing the key again, why does it only do that sometimes but sometimes it also plays the animation once again?