Several ways to do this. Here are a few:
To start:
You can either setup an input action event for mouse wheel up and mouse wheel down in project settings under the input section. So that when you scroll up or down it will fire the designated events.
Or in the same section you can setup an input axis event where it creates an event that fires logic based off whether your mouse wheel moved in the positive direction or negative direction(Variable starts at 0 which is no input, 1 is up input, -1 is down input).
After that section:
On your player controller, character, or pawn you setup those events to be called and run your logic. For the scenario you described it sounds like you want the player’s movement to be a direction decided by the player and the distance moved decided by the developer.
Whenever the player wants to move, after they have determined their direction. Have the mouse wheel up or axis up fire off the event that moves the player x distance along the xyz direction determined by player(player forward vector), turn off gravity and physics while in movement, and keep other variables in mind to keep the distance exact.
Then you can do the same logic, except the direction reversed for moving backwards.
If you want to keep the player moving along the same path that they initiated instead of being able to change direction when they go backwards, you can create spline on initial movement that saves original location, next moved location, and all locations moved to. Your mouse wheel events can then be coded that when you scroll backwards it takes you to the last spline point, or last point the players was at.
Hopefully this helped. If you have any more question please describe a bit more in detail what you are trying to achieve for more specific answers.
EDIT: Also if you are looking for smooth movement along the spline and the distances are exact. You can setup an anim montage that syncs up with time it takes to move between points and play a standard ground forwardmovement animation.
Or if not using a spline. Simply set it up a root motion animation that goes specific amount of distance and animation playrate matches movement rate.
This can also be done using sequencer, create the walking sequence with time/movement matching distance and time moved. Play it every time the player moves.