I copied and pasted your code into a new script, and get the same result - when I lift my finger off at the end of a stroke, the alpha value of the whole stroke changes (gets lighter).

I am running the latest version of Pythonista (3.2) using python 3.6 on a 10.5” iPad Pro with iOS 11.2