block_searchcourses: define AJAX_SCRIPT conditionally

AJAX_SCRIPT is defined many, many places in Moodle.  Redefining it throws a awanring, so it should be defined conditionally. 
http://code.metager.de/source/search?q=AJAX_SCRIPT&project=moodle