Thanks for the comment!
I went back and checked, and I do think you are right (the code as written does the first delay, which makes it look like its working), but it doesn’t properly end the timeout because, as you note, the timeoutId is not shared, so it submits the end state of the code multiple times.
This is a bug that has been in the code since the first edition and nobody caught it.
This will be fixed in the next beta.
Thanks!