I don't actually know the answer to this question, but I'm going to think through it so that -- following Cunningham's Law -- we'll both get the right answer out of it.
OK, so here are the steps I would expect
1) Find out where (at what memory locations) the high score value is stored. I've never used them for the NES, but there should be debug tools that allow you to search RAM for a particular value, or to notify you when a value is incremented. The tricky thing is that the score can be stored in several different formats (e.g. binary-coded decimal), and with different byte orders.
2) Next, you need to write a short piece of assembly code that will read those memory locations, and write them to the SRAM. I think that's just a matter of the assembly instructions LDA and STA (not sure if A is the right register to use), and it should be easy enough to find out what the opcodes for those are so they can be written in pure hex. I'd write them here, but I've programmed very little assembly code, and don't fully understand the different address modes like zero-page and absolute; some of it's noted here
. The other thing you need to know is the memory location of the SRAM, and that's available from various docs AFAIK.
3) You'll also want to write a short piece of code that does the reverse of the above when the game first boots up: reads the SRAM, and writes the high score to RAM. That, in itself, should be easy if you can do #2.
4) Now, this is the intimidating part: you need to find unused or reclaimable space in the ROM to put in the code you've written, and a small amount of space to put in JSR (jump to subroutine) instructions to jump to that code and execute it. Just inserting the instructions will screw up the ROM completely, so I think what most people do is to find existing commands that can be NOPed and replace them with JSRs of the same byte length. One JSR needs to be executed when the game first boots up, and only then; the other needs to happen at some point in the GAME OVER sequence.
As for the subroutines themselves, it's usually much easier to find unused space at the end of a ROM page to put in instructions, so my naive impulse is to put the code somewhere with a lot of $00 or $FF, JSR there, RTS back, and hope for the best. With a small ROM that may be OK, but in a big one there's apt to be some sort of mapper or bank-switching disaster.
OK, now that I've given you what I assume is a terrible and naive answer, I look forward to reading a better one!