Sounds like you did it the right way.

I have also seen them attempt to climb into boats. Another simple way to handle this is to just move the boat backwards or forwards.
Cottonmouths are not really water snakes. They will stay around water to catch food and they like swimming on the surface; their bodies are very fat and lite so they swim with most of their body out of the water. if they are swimming toward something and encounter a boat, perhaps mistaking it for a log, they may attempt to climb up on it rather than going under it or around it. True watersnakes will dive.
We humans tend to assign human intentions and human intelligence to animals that they just don't have. The best way to handle one trying to get in the boat is to just put your paddle between yourself and the snake and gently put it away or just move the boat in a perpendicular direction from the snakes line of travel. They will usually cross your path and continue on their way. Swinging a paddle wildly or trying to hit the snake may cause it to panic and try even harder to get out of the water. Some Cottonmouths will try to flee the scene by swimming away or diving but others may try to stay and fight when threatened. That depends on the temperament of the individual animal.
“What we do for ourselves dies with us. What we do for others and the world remains and is immortal.” Albert Pine