yes i was successful. thanks for that.
in the meantime i could try the script on another computer. and it worked perfect. like on yours. then we compared everything we found - and the difference was, that my version animate cc 2021 was not with the latest update. after the update of animate cc 2021 - it works! i wonder, why adobe did not inform, that there is an update and that the older version of animate cc 2021 had quite a heavy big bug.
im very sorry to have kept you busi with my problem. but i learnd quite a few things. thank you so much for your kindness and help!
during all the tries and errors i thought, maybe the reason it did not work right is, that it was not on the main timeline. so i made a version on the main timeline. when i publish it, it counts perfect for the first run. if i click again it starts at frame 1. with the second click it jumps to frame 3, then to frame 5, then to frame 2, again to frame 5 and after a few clicks more it even jumps backward. strange things still happen also with the super-newest version...
i've had the previous versions and never encountered that, and i've not seen anyone else report that issue. my guess is a clean install of that same version would have fixed the problem, too.
but there's not need to test that. all's well that ends well.