You have to set up lacing. Some functions require cross product lacing, but code blocks default to auto just like regular nodes. Read more about lacing in the primer:
If the link doesn’t take you there automagically, scroll down to the ‘How About Lacing?’ section.
Here is your fixed code block:
//Base Curve
c1;
//Number of Divisions
n*10;
//Scale Wave Extent
w = 180;
//Scale Wave Height
h = 0.5;
//Points on Curve
p1 = c1<1>.PointAtParameter(0..1..#n<1>);
//Normal at Points
n1 = c1<1>.NormalAtParameter(0..1..#n<1>);
//Scale wrt Base Curve Length
s = c1.Length/(Math.PiTimes2*w);
y = Math.Sin(0..360*w..#n<1>) * (h..0.1..#n<1>) * s<1>;
p2 = p1<1>.Translate(n1<1>,y<1>);
//Nurbs Curve
c2 = NurbsCurve.ByPoints(p2);