Setting limits for following the mouse on the y-axis

hey there i’ve been looking through the forums and online and i can find stuff that is close to what i want but not exactly. i have a face and i have the eyes following the mouse and would like the eyelids to move as well but not move past a certain point. i’ve tried doing if-else but as you’ll see my coding needs improvement, lots. i have attached two versions. one that has easing which i would love to include but i will settle for just limiting the movements. if anybody could help me i’d greatly appreciate it.