The script just needs to be downloaded to the SD card. If you edit the file, it must be saved as plain ASCII text. For lua scripts, the extension must be ".lua"
Scripts are normally put in the CHDK/SCRIPTS directory, but that's just a convention, you can load scripts from anywhere on the SD card.
LUALIB is used for modules loaded by lua scripts with require(). You should not normally put scripts there.