If I have understood correctly what you want to do, then using an IF is not complicated at all. Just put this in Construct.
Condition: Y < X ; Action: Set Variable Y to Y + 1
Condition: Y > X ; Action: Set Variable Y to Y - 1
For the first one, while Y is smaller than X, it adds +1 to Y each time the event is checked.
This event runs roughly 60 times per second, so it would mean Y would be changed by roughly 60 in the course of a second. Change +1/-1 to anything else to increase/reduce the speed of change.
If you want to set it to another value immediately, just change
Set Variable Y to Y + 1
Set Variable Y to <Value>