I forgot to convert the angle back to radians -.-" The following code fixes my issue. Line is now drawn with an angle with degree 0, 45, 90, 135, 180.. etc
if (l_vIsCtrlPressed) {
var length = Algo.Length(p1, p2);
var angle = Algo.Angle(p1, p2);
angle = Algo.ConvertToDegrees(angle);
angle = Math.round(angle / 45) * 45;
angle = Algo.ConvertToRadians(angle); // FORGOT TO CONVERT BACK TO RADIANS
p2.x = p1.x - length * Math.cos(angle);
p2.z = p1.z - length * Math.sin(angle);
}