This logic isn't quite right. The cursor will never go anywhere if it's on a mark going backwards. I think you should do a strict before/after comparison here.

This whole section could be simplified quite a bit yet again if you use ternary operators, like 
```
  markIsAfterCursor = (motionArgs.forward) ? cursorIsBefore(cursor, pos) : cursorIsBefore(pos, cursor)
  markIsAfterClosest = (motionArgs.forward) ? cursorIsBefore(closest, pos) : cursorIsBefore(pos, closest)
```
Doing it this way also makes it easier to make forward/backward direct opposites of each other so you don't make logic mistakes like this.