sort the scripts, ask if the script fails
updated hook documentation
moved script searching to a separate function
updated documentation