We’ve had a look at the PDF and the script seems alot more complex than the lines you’ve provided so far. The end result has 4 plots (the Warning line, then 3 Dev lines which swap from Above to Below the warning line based on the position of the close. This would require several nested IF() functions to handle the flipping.
It maybe possible, but you would need to request a scripting consult if you wanted us to look into it in more detail. We can review and provide a estimated quotation based on what we find.