The code that I wrote does the "wave compensation" by simply pretending that there are no errors, except heading versus bearing.
The errors caused by random wave action cancel out on average! You are overthinking the problem, and some experiments will show that this really does work.