Can I use Python scripts to control and adjust the distance between any two parallel lines

degrees and atan2 are common graphics function and not specific to Glyphs. In Python, they are provided by the math module (hence the from math import degrees, atan2 on the first line).

I am not 100% sure what you are trying to do but this code might help: