We plan on using the ConnectPort H4 (Wifi/Ethernet model). Gateway Software Modification

Need to know if there is a way to program/modify this gateway software to support proprietary protocols over Serial , Ethernet?

Alternately, can we add our own agent which will route information to other servers in case say a connection to the Internet is not available?

For your first question you need to contact Digi Engineers i think.
Regarding your second question, through a python program you can route the data to your servers.