There are way too many possibilities here. So...rather than feed you the exact script (which would probably not work for your environment anyways ), let's post the things you need to know in the order you will probably want to learn them.
How to Script within ThinApp -
ThinApp Script Template -
Scripting Validation Logic Into a ThinApp Project/Package -
Google Search of VBScripting Subnet Detection Examples -
-Dean F.
-Dean F.
https://www.vmware.com/support/pubs/identitymanager-pubs.html