That was an example of function usage. It rotates input around world's up using "Turn" parameter, where 1 does full revolution around axis. No need to set @P in your case. If you want to use roll attribute to control rotation instead, replace ch("turn") with @roll. There is no roll attribute defined on points in scene file, angle will be always zero for default ramp. Code you need now will be something like this:
v@up = {0,1,0};
@N = normalize(@N);
v@binormal = normalize(cross(@N, @up));
@up = normalize(cross(@binormal, @N));
matrix3 mat = set(@N, @up, @binormal);
float angle = chramp("ramp", @roll) * radians(360);
rotate(mat, angle, @N);
@orient = quaternion(mat);