Hmm, I think I've partially answered my own question. I deleted the compiled .pex files, then ran the game, and the mod didn't work, so the .esp doesn't contain copies of them. I then re-compiled them with Papyrus Compiler, ran the game again, and the mod worked ok (and the version of the scripts was the correct one). So does anyone know why sometimes the game doesn't seem to pick up the newer scripts? Does it cache them somewhere or do some checking for timestamps (maybe comparing the .esp modification date with the .pex modification dates?)