Here's how to run a scan script under the command line:
1. Change to the directory where the scan script is saved
$ cd /home/plex/Library/Application Support/Plex Media Server/Scanners/Movies/
2. Run the scan script with the library path set
$ PYTHONPATH=/var/lib/plexmediaserver/Resources/Plug-ins/Scanners.bundle/Contents/Resources/Common python2 Plex\ Series\ Scanner\ \(with\ disc\ image\ support\).py /path/to/test/with/scanner
Make sure not to put a trailing slash on the /path/to/test/with/scanner ! (i.e. don't do /path/to/test/with/scanner/ )
In the case of the Series scanner, I had to cut the __main__ code and post it at the end so it could find all the functions. Haven't gotten my scanner working quite right yet but that's another story...