sprite.x>sprite.lastx set sprite.targetangle to +20
trigger once
sprite.x<sprite.lastx set sprite.targetangle to -20
trigger once
every tick rotate 1 degree towards targetangle
set sprite.lastx = sprite.x
Make sure you have these events occur after the movement of the sprite. The trick is to compare current x and last x before last x is updated to current x.
You will also need to sub these events for your two situations, one set for upwards facing and one set for downwards facing. You can also add if X didn't change, set the angle to 0 or 180 to have it face up or down.
(actually you should use rotate 60*dt degrees instead of 1 degree, see construct.net/en