If you are creating an AppleScript application (in the Script editor, go to File> Save As ...> Enter "Application"), you can set the icon and a convenient name. Save the application with the name that you want to display in the warning window (replace "osascript"). Install the icon by opening a new application package and replacing the applet.icns file with your own icon.
If you need to call this from the command line, you can use the open command.
source share