Limit travel on steep angles?

I’m using this, it seems to work OK: BetterCharacterControl Slopes - #7 by duindain.
The code part I’m using is from vvishmaster. EDIT: Post 12 that is.