You should probably put that in code tags (with proper indentation), it's very hard to read. Or use something like Pastebin
for syntax highlighting.
Other than that, you have to seek to the position in the NES ROM from which you want to start decompressing. Also, you have to figure out what kind of RLE your game is using. It might not always be count, value, count, value, ..., but there might be a special byte code marking RLE encoded data. Last but not least, you have to know when to stop decompressing. For compression, it's the same, just the other way around (though you usually know the length of your data by looking at the input file's size).