How to get normals of a 2D line and to integrate along it

I’m not worried traversing the cells in a random order but I’m worried about getting consistent direction of normals. I just want to adopt a precautionary approach because I’ll have to use this script with different cases.
I can think of a simple common case where the input mesh may be weird. Let’s say the surface of the airfoil is input with two different set of points (blocks or zones): the lower surface and the upper surface sets. The first is entered clockwise and the second is entered counter-clockwise. What do you think about it ? As I am writing I realize this may seems an exaggerated claim of robustness, but for publication-quality result robustness is the minimum.
Thank you