Lua scripting is approximately 100% of the reason why I use Simpletask, and ST is maybe 80% of the reason I use todo.txt (the other 20% is being able to do something reasonable with the file in a plain text editor)
When you create the widget, it uses whatever settings are currently in use in the app. That includes lua scripts. You can also edit it afterward. I'm a little unsure of where your confusion is, because it is quite easy to try and make two widgets and test for yourself whether it works
elmussol:elsmussols.net @elmussol:elsmussols.net notes the appearance of Simpletask Nextcloud in F-droid today. I have up until this point been using Simpletask Cloudless and having Nextcloud keeping todo.txt and done.txt autouploaded from a monitored directory.