Detecting diagonal movement and increase/decrease speed

While a lot of FPS games typically use a sprint/Left Shift to increase character speed, I am wanting to go with the Goldeneye/Perfect Dark approach where strafing while moving forward/backward gradually increases the speed.

Problem is, with my current code, I can’t seem to find a good way to detect whether if the player is moving diagonally or not, outside of using “Input.GetAxis(-axis-) !=0”.
I’ve also had to make two functions for increasing/decreasing speed, which seems kind of hacky.

Would rather be able to do something like “If W/UpArrow !=0 && A/Left Arrow !=0”, which may cause issues in regards to keybinds.
Is there any way I can clean up my code and are there alternate ways of detecting whether player is moving diagonal?

    /
 private void Update()
   {   
       movement = new Vector3 (Input.GetAxis ("Horizontal"), 0f, Input.GetAxis ("Vertical"));
       playSound = GetComponent<AudioSource> ();
       if (Input.GetKey (KeyCode.LeftControl)) {
           Crouch ();
       } else {
           Stand();
       }
       UpStep.transform.position = new Vector3(UpStep.transform.position.x, stepHeight, UpStep.transform.position.z);
       if(Input.GetAxis("Horizontal") !=0 && Input.GetAxis("Vertical") !=0)
       {
           rareStrafe();
       }
       else
       {
           decreaseStrafe();
       }
       
   }
       
   private void FixedUpdate(){

       Move();
    // This function is for a part in code regarding stairs
       DetectSteps();

   }

   private void Move()
   {
       Vector3 MoveVector = transform.TransformDirection (movement) * moveSpeed;
       rb.velocity = new Vector3 (MoveVector.x, rb.velocity.y, MoveVector.z);
       if (Input.GetAxis("Vertical") !=0 || Input.GetAxis("Horizontal") !=0)
       {
       anim.SetBool ("walk", true);
       }
   else {
           anim.SetBool ("walk", false);
       }
   }
   
   private void rareStrafe()
   {
// Gradually increase speed
       moveSpeed += accel * Time.deltaTime;
       if(moveSpeed > 4)
       {
           moveSpeed = 4.0f;
       }
   }
   
   private void decreaseStrafe()
   {
//Decrease the speed
           moveSpeed -= deAccel * Time.deltaTime;
           if(moveSpeed < 2f)
           {
               moveSpeed = 2;
           }
   }

If you want to detect lateral movement rather than merely pressing the button:

float lateral = Vector3.Dot(mything.velocity,mything.transform.right)

Throw in a Mathf.Abs() if you want the value to always be positive.

Otherwise I don’t see a problem with detecting input or simply recording an ‘isStrafing’ value wherever you are handling movement. Or is it that you didn’t write the movement code and don’t want to go messing with it to add strafe detection?

I took the movement code from a tutorial and I don’t know a lot about vectors to be honest.
However, a boolean value to detecting strafing sounds like a good way to clean up code a little