I’ve made a post here about my solution to it:
Essentially you just calculate the farthest distance that the mesh would have to move for both feet to touch the ground, and then set its displacement of the model to that distance. The forum post has links to downloads that can demonstrate this and provides solutions to various issues that I found in the process of making it.
It still has a few minor problems, but it at least gets it working.