If/else statements inside an " If GetButtonDown"

Hello. I was just wondering if it is possible to have an If/Else statement inside an If GetButtonDown statement. I have no idea how to script but if it is possible I would like the script to work like this.
There will be a private varible called AimState, this variable will always be either 1 or 2. When I right click the script would check if AimState is greater than 1.5. If it is it will play an animation and then set AimState to one.
If the script finds that AimState is not greater than 1.5 it plays the same animation but in reverse and sets AimState to 2.

Im srry if this doesn’t make sense but any help would be appreciated.

Yes you can, with something like:

void Update () {
	if(Input.GetButtonDown("AimInput")) {
		if(AimState > 1.5) {
			//Play your anim stuff
			AimState = 1;
		}
		else
		{
			//Play your other anim stuff
			AimState = 2;
		}
	}
}

Just remember to set your AimState on Start or Awake to either 1 or 2 and it should work.