Maybe detecting the player & NPCs altitude related to the sea and calculating the last second (or less) variations in altitude when walk or running, and then determining the output speed at each moment would be possible and easier. The speed change would result a delay of that second or less but it would be perceived naturally because the natural acceleration/deleceration of the bodies. I hope someone with papyrus os SKSE experience creates the mod. It would be a great immersion improvement to the game.