Or, Toady could use the far simpler method of marking those tiles as dangerous when he creates the waterfall initially, and then simply make pathing avoid those dangerous tiles. I mean, dwarves already avoid walking into lava or crossing deep water, really, how hard would that be?
What criteria do you suggest the game use to determine those tiles are dangerous? Magma is automatically marked as impassible at any depth. Water is marked as impassible when at 4/7 or deeper. The tiles on the edge of the waterfall are at less than 4/7 deep, so they aren't marked as impassible. To mark those tiles as dangerous, you'd either need to mark all water at 1/7 or deeper as dangerous, or add in a special status to just those river tiles marking them as dangerous even when the game wouldn't normally consider them as such. Presumably they'd then remain marked dangerous even if the player did something like divert the river. It would be a bit of a clumsy way to solve the problem, adding a special-case exception to the normal game logic.
How about this? If a tile is both a location of moving water ("flow" is turned on for that tile) and adjacent to an open space (or map edge?), then it would be marked as a waterfall edge and tagged as "dangerous" (avoided for pathing). That "dangerous" tag would have a counter that would count down periodically, and if it reached 0 it would be treated as "safe". However, if the tile was covered in 3/7 or higher water, the counter would be reset instead of counting down. (The question of how high to set the counter when it is reset depends on how often the counter counts down, which should be infrequently.) That way it would always be treated as "dangerous" and prevent pointless "cliff diving", unless you blocked, drained, and/or diverted the river in some way, where after a short period it would become "safe" until 3/7 or higher water passed over it again.
Yes, it's a special case, but it's an easy to implement case with little impact on processing time.
This would make creatures behave in an apparently rational way, and would save you the hassle of having to go out of your way to keep dwarves and traders from falling to an unnecessary death.
Sound good?