you can write the script to use arguements from the comand line.
lets say that argument 1 is the step number.
./myscript.php 2 would be the command. you would use $argc (argument count) to see if there are more than 1 (the first being the script name) and $argv (argument var as array) to get the argument.
in this case $argv[0] = myscript.php and $argv[1] = 2
so instead of checking for $step, you can check $argv[1].
another option you have, instead of doing it in chunks is just to slow downt he whole process. I assume you are useing some sort of loop to put the data in to the DB, You can use usleep() or sleep() to put a pause between each entry.
which ever tickles your pickle 🙂
hope that helps.