I don't know enough about Lua or FCEUX to answer definitively, but I might be able to see some breadcrumbs. First of all, they are not the same error. The first error is about the function "readwordunsigned," and the second error refers to an undefined variable "ppu." Since it is a script, the second error suggests that the first error was not a problem for v2.2.3. Otherwise, the error would have occurred earlier on line 11. The problem on line 15 is that it's trying to ask an object named "ppu" to perform a function called "readbyterange," but the interpreter does not know what the "ppu" object is. So, either there is a version of FCEUX where "ppu" is defined such that it can be accessed from anywhere (like the object called "memory" in the script), or the programmer forgot to define what "ppu" is in the context of that function on line 15.
I would try to find another version of FCEUX that has "ppu" defined like "memory" is. Or manually try to do what the script does...
It appears to be copying swaths of memory into separate files in the dumpData function. The first argument of readbyterange appears to be an offset, and the second argument is a number of bytes, both in hexadecimal. You can easily copy and paste from a hex editor based on these offsets and sizes to create the files yourself. If you are not comfortable doing this in a hex editor, reply here and we can help with that.