Actually, there are several things wrong here. Immediately after you are sending the page erase command, you are sending the program command - but the Flash module is not yet ready. You need to poll the FCCF bit in the FSTAT register to see when the module is ready for another command.
Also, you say you are writing an 0xFF to address 0x5000 in Flash. When Flash is blank, it reads 0xFF, so in order to test it, you should be writing anything except 0xFF in order to see if it's working.
Another thing, you only did a page erase, not a mass erase, so you need to run the blank check command as part of the security measure before you can run the program command. I think this is an extra step to make sure runaway code doesn't write over the Flash.
I highly recommend you read the Flash section of the datasheet a few times to become more acquainted with it. I've never worked with this particular device and I only scanned the datasheet for things that jumped out at me and I could still be missing something.