Sync listening port is grayed out because it is defined in the configuration file sync.conf (and thus overrides the UI setting). To enable manual editing via UI you need to connect to the NAS via SSH and remove the setting
from "sync.conf" file (respect the JSON-syntax, especially the comma in the previous line, that might be unnecessary after editing).
The file is located in the Sync Storage folder, which is placed differently in DSM6 and DSM7, see here: https://help.resilio.com/hc/en-us/articles/206664690-Sync-Storage-folder
After Sync restarts, changing the port manually should be available, but you must be sure the chosen port is free.
The failsafe and recommended way to change the listening port is via the SSH by editing of the configuration files and checking the port, as described in this article: https://help.resilio.com/hc/en-us/articles/360014432100-Change-listening-port-on-Synology-