A simple mask like this can just be done by checking if the UV coordinate is within the desired range;
//This will be 1 if the UV is within the range of [min,max] and 0 otherwise
float getMask (float2 uv, float2 min, float2 max)
{
return uv.x >= min.x && uv.x <= max.x && uv.y >= min.y && uv.y <= max.y;
//Alternatively, a faster way of doing the above
return all (abs (uv - min) <= max);
}
...
half4 MainColor = tex2D (_MainTex, newuv);
half4 ArmUpperColor = tex2D (_ArmUpper, IN.uv_ArmUpper);
//UV is in a range of [0,1], so get a mask of the first quarter [0.0,0.5];
half mask = getMask (IN.uv_ArmUpper, 0.0, 0.5);
//Note that this may be flipped vertically, so alternatively use this;
half mask = getMask (IN.uv_ArmUpper, float2 (0.0, 0.5), float2 (0.5, 1.0));
//lerp() will do the same thing as your mask in the code sample
o.Albedo = lerp (MainColor, ArmUpperColor, mask);