It is important to note that, when Sparrow is on a boat of any kind in the five films, he stands completely balanced.
On top of this, it could also be argued that Sparrow is smarter than he seems.
The rascal has outsmarted his foes in the past, and his constant swaying and bobbing could be a ploy to disarm any who might oppose him.
This may have been displayed during Sparrow’s sword fight against Captain Barbosa (Geoffrey Rush) in Curse of the Black Pearl. Throughout the entire fight he has no trouble keeping his balance.