To use a script within ThinApp, simply create the script in the root of the ThinApp project folder before building.
The aforementioned blog post has been updated with a newer version of the script in case you are NOT using ProcessExternalNameBehavior=Original in the [Build Options] of your PACKAGE.INI. The old script shown above in this thread will still work so long as you are using the ProcessExternalNameBehavior=Original [Build Options].
See the ThinApp Pubs - Creating ThinApp Scripts documents and the ThinApp Blogs Scripts section for more assistance.