The movement example in the link to the manual contains already gravity, quite similar to that in yours.
The floordistance makes it impossible to prevent running up very steep slopes though. I think it would be easiest if it simply were possible always apply gravity to the ellipsoid but for that the collision system doesn´t seem to be robust enough.
What you are asking for is actually a physics system.
Instead, you could add to your code something like:
- get the normal of the ground,
- if it is too steep,
- push the entity in direction of the normal.