This seems to be a fairly typical example of Biblical repetition, but the difference, as Henry pointed out, is that in the first passage, what “the Lord said in his heart” is, remarkably enough, revealed to us, while the second passage says what he said to Noah. Both specify that God will never again destroy man in a Flood. But in fact, the Gen 8 divine self-reflection is more elaborate than the Gen 9 covenant, except that the covenant includes the bit about the rainbow. It is possible that there were indeed two separate oral narratives (i.e., texts written to be read) written down by Moses and placed one after the other, and like the toledoths, they featured repetition because they overlapped. The first is backward-looking, letting the eight remaining people know they need not fear something so terrible happening again. The second is forward-looking, being placed in the context of new instructions to “be fruitful,” and of the first law.