First of all I'd really like to thank you so much for your time and effort in helping with this, it's really appreciated, so thanks so much.
I tried running the code and it makes sense that it would toggle File Sharing on/off everytime it runs. It compiles great, but as soon as I run it, it seems to be stuck in an infinite loop as you can see in the attachment below and the only way out of it is force quitting AppleScript.
I also left out the System Settings window to see if the File Sharing checkbox was being 'clicked' and it hasn't. I tried simply adding and comibining the click the checkbox code with the previous code without the variable to just turn it on or off statically and couldn't get it to work.
If anyone could try the code just to see if the result is the same it being stuck in a loop would be great.
Thanks again to everyone who's helping!
View attachment 2363645