Character moving with gampad stick

I make a game for mobile and i use a gamepad joystick for moving, and I want to add double tap to run, is that possible?

using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerMovement : MonoBehaviour 
{ 
    [SerializeField] private float walkSpeed;
    [SerializeField] private float runSpeed;
    private float moveSpeed;
    private Vector3 moveDirection;
    private Vector3 velocity;

    [SerializeField] private bool isGrounded;
    [SerializeField] private float groundCheckDistance;
    [SerializeField] private LayerMask groundMask;
    [SerializeField] private float gravity;
    [SerializeField] private float jumpHeight;
    [SerializeField] private float rotationSpeed; // Speed of player rotation
    [SerializeField] private InputActionReference moveActiontoUse;
    //REFERENCE
    private CharacterController controller;
    private Animator anim;

    private void Start()
    {
        controller = GetComponent<CharacterController>();
        anim = GetComponentInChildren<Animator>();
        moveSpeed = walkSpeed; // Start with walk speed
    }

    private void Update()
    {
        // Read joystick input
        Vector2 moveDirectionInput = moveActiontoUse.action.ReadValue<Vector2>();

        // Move the player
        Move(moveDirectionInput.x, moveDirectionInput.y);
    }

    private void Move(float horizontal, float vertical)
    {
        isGrounded = Physics.CheckSphere(transform.position, groundCheckDistance, groundMask);
        if (isGrounded && velocity.y < 0)
        {
            velocity.y = -2f;
        }

        // Set the movement direction based on joystick input
        moveDirection = new Vector3(horizontal, 0, vertical).normalized;
        moveDirection = transform.TransformDirection(moveDirection);

        // Rotate the player in the direction of movement
        if (moveDirection != Vector3.zero)
        {
            Quaternion targetRotation = Quaternion.LookRotation(moveDirection);
            transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, rotationSpeed * Time.deltaTime);
        }

        // Regular movement
        if (isGrounded)
        {
            if (moveDirection != Vector3.zero && !Input.GetKey(KeyCode.LeftShift))
            {
                Walk();
            }
            else if (moveDirection != Vector3.zero && Input.GetKey(KeyCode.LeftShift))
            {
                Run();
            }
            else if (moveDirection == Vector3.zero)
            {
                Idle();
            }
            moveDirection *= moveSpeed;

            if (Input.GetKeyDown(KeyCode.Space))
            {
                Jump();
            }
        }

        // Apply gravity only when not grounded
        if (!isGrounded)
        {
            velocity.y += gravity * Time.deltaTime;
        }

        controller.Move(moveDirection * Time.deltaTime + velocity * Time.deltaTime);
    }

    private void Idle()
    {
        anim.SetFloat("Speed", 0);
    }

    private void Walk()
    {
        moveSpeed = walkSpeed;
        anim.SetFloat("Speed", 0.5f);
    }

    private void Run()
    {
        moveSpeed = runSpeed;
        anim.SetFloat("Speed", 1f);
    }

    private void Jump()
    {
        velocity.y = Mathf.Sqrt(jumpHeight * 2 * gravity);
    }
}

I have not implemented this myself, but if you are using the new Input System then you should look into defining a Multi Tap Interaction for your Action:

image

Here is the documentation:
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Interactions.html