Yes your understanding of the cymen file is correct.
Now coming to the issue you are facing - before you update the Number of address bytes value, you should understand the extended address mode of the S25FL512S device. The commands that the file generates support extended addressing but by default these commands are meant to work with 3-byte addressing and not 4. In order for you to use the same commands with 4-byte addressing, you will need to set the EXTADD bit of Bank Address Register (see flash datasheet). For this you need to send a Write register command like shown below -
Cy_SMIF_Memslot_CmdWriteEnable(base, memDevice, context);
uint8 bankRegisterValue = 0x80; //sets EXTADD bit in the Bank register
Cy_SMIF_TransmitCommand( base, 0x17, /* 0x17 - BRWR, bank register write command */
After you have enabled EXTADD bit/mode, you will be able to use 4-byte address instead of 3-byte with the same commands. Note that there are dedicated Erase/Read/Write commands for 4-byte addressing. If you are interested in supporting both, then you can implement addition Read/Erase/Write APIs using the 4-byte address commands - refer to flash datasheet for details.
One other note, when you perform an erase, the value read is not 0. It is 0xFF i.e. erase sets the bit not clears and a write can ONLY clear a bit and not set. This is typical for any NOR flash device. This is the reason you need an erase (to set all bits) and then perform a write (clear the bits that are 0) .
Hope this helps.
Meenakshi Sundaram R