block_searchcourses: define AJAX_SCRIPT conditionally