512 characters is a limit hardcoded in the firmware, with the following variable in the .config file in the SDK:
In order to increase this value you would need to modify the .config file and compile your own firmware using SDK. SDK for the latest firmware can be downloaded from here. For instructions on how to set it up, please refer here.
As a workaround, if possible, depending on the contents of messages, maybe they could be stored in script files, and, instead of typing messages in the CLI, you could simply execute the script.