Make them warm blooded
The titanboa, the largest known snake, offers a look into what would be needed to make bigger snakes. It existed in a considerably warmer climate, but it's going to be hard to get that in an ocean.
The first thing, therefore, is a higher metabolic rate. Snakes are cold blooded, and limited in growth by this - I'd imagine there's a limit to how large a snake a cold blooded metabolism could support - at a point, the relatively sluggish digestive system would be a limiting factor
So, making them warm blooded would remove this limit, and, as such, the size limitation - no reason a sea snake can't be as large as a whale shark in this case.
It's obviously not the only limit, but I'd imagine it's a big part of the problem - a warm blooded sea serpent is going to be able to chase down prey, and move faster when it comes to capsizing boats, too. A warm blooded metabolism is also cheaper to maintain the larger the creature gets - the square/cube law working in our favour, for once!
I can't see any other reasons that sea snakes couldn't evolve to enormous size - there's no limits on their internal organs being crushed by their own bulk, or of having to develop massively stronger skeletons.