updated download_script method to optimize time of processing script download request
added functionality for downloading and storing missing scripts in database