I have a limited amount of experience with the sudo command, but I know that you can create your code with a texteditor, and use the chmod command to change permissions and different ways people can access your code.
More specifically, once you've got your .command file, you can go into your emulator and type in chmod. Add a space after that, and then you can customize the users who can actually interact with the code. For example, chmod a+rwx means that everyone (a) can have the privileges of Read, Write, and Execute (rwx). There are many ways chmod can be used, and this webpage, is a good resource for finding out those ways:
http://www.zzee.com/solutions/how-to-use-chmod.shtml
After the chmod and the user/permissions parameters, you can add the filepath of your code at the end to tell UNIX which file to chmod. After that, you can manually change the members of the administrative groups that may run the code to allow for better flexibility, as CodeGnome suggested.