Not as you have it. For what you're using, you could just put it all on one line. If you had a lot of code to be run, on the timer, then you could put the code into an alias, then call the alias from the timer.
For your code, as you have it shown
checkfiles:
/timer 1 10 { if ([txt] isin $1-) && ($1 !isupper) { write txtfiles.txt $1 } }
/timer 1 10 { goto writefolders }
You also have an extra } in your code.