Hi Christoph,
good idea to use the intensity field to do your calculations.
There is no straight way to put your scan_angle_rank to intensity.
Easiest is may to do it the good old ascii way:
las2txt -i in .laz -o tmp.txt -parse xyza -translate_scan_angle 128
txt2las -i tmp.txt -o out.laz -parse xyzi
Because scan angle is a signed byte with a range of (-128..127) and intensity is
unsigned you have to shift your scan angle by 128 to avoid range violations.
Good luck!
Jochen @rapidlasso