You need to have the animation keyframes mathematically matched between the animations. In other words you need functions for finding the relevant keyframe in run animation to current walk animation frame.
It's all about finding the same key points in each animation and getting down their locations. For example Left foot touches the ground at frame 25 of 100 in run animation and frame 50 of 200 in walk animation. Divide relevant keyframes by animation duration and you get the percentages you can compare and match between animations. Hopefully the animations were made so that the key points are in same order starting point wise because that makes you job easier. If not, then you need to add/substract an offset like 0.3 to the percentage accordingly.