For script tools, again do not manually delete the intermediate data. Shapefile scratch workspace still generates the file locking errors. So for intermediate data, use a file geodatabase, file geodatabase scratch workspace, or in_memory workspace.If you must manually delete intermediate data, or other output created from your script or model, use FGDB. The inputs can still be SHP, but what you are deleting should be FGDB.*.py file has been included.