Hmm got it worked.
I added +100 at the end of calculation.
walk_percent = (walk_percent + sign(spdx)*6*time_step)%100+100;
Now the percent runs between 100 and 200 and when reversing animation it runs nicely from 200 to 100 thus creating the backward motion. So why didn't the first code work, though it should have?
I saw that animation didn't run from last frame to first. Function seems to cycle always from the very first frame. And when creating backward motion and reaching to the first frame it starts from the first frame again showing only one frame.