Peter
I don't know if you found a solution, but this is what worked for me on the xampp version of 1.8.2, I will try this on my production server - 'fools rush in.....' and all that! And that's another thing, I've been using Moodle for a little over a year and still have HUGE gaps in my knowledge and I have no idea about coding, programming, languages etc. So no guarantees or suggestions that this is the right answer!
Going into '\moodle\course\format\topics\config.php' in each of the course formats I was able to define exactly which blocks I wanted to see on the course pages.
I then copied the resetblocks.php script into the moodle folder (the one that contains 'config.php & config-dist.php) copying it anywhere else does not work; I know, I tried it.
Run the script - in Moodle 1.8.2 the blocks on the front page are reset to their default, but the course pages are reset to the options set in the config.php file.
ian
Using
DELETE FROM `mdl_block_instance` WHERE `pageid` = n;
worked fine for both a single courseid or a range of courseids.
I've got the default blocks set using site wide sticky blocks (using moodle 1.82+) so once i removed the entried in mdl_blocks_instance my preferred blocks were present (without any duplicates etc).