If you have store in a variable the text you want to typewrite you can use len(variable).
Oh my judge you're a genius. I don't even know what I did, but I did it and it's working great!
My only two concerns is that it works only if the variables duration and character amount are global. Other that that, it's great.
Now I have to find out how to make multiple scripts without using only the events. What did you use for your project?