You can use standard socket code to read a socket and then send it out the RS485 port. Probably you'll need to have a thread to listen to the socket, a thread to talk to the RS485 port, your main application, and a semaphore to mark who "owns" the RS485 port. When the main application needs to talk to the RS485 port, it will take the semaphore, which will block the socket thread from passing its data, send its data, then release the semaphore so that the socket thread can continue. The socket thread will do the same whenever it has data to send, take the semaphore, send the data, then release it. Neither should hog the port for too long. Presumably your data will be "bursty", as in, individual commands or sensor readings or the like, which will give you natural points at which to decide to send it versus buffer it. If your app needs continuous data from the outside, you'll need to work out another mechanism to let the Digi app take over when it needs to.
Look in the help, and on the net, for socket functions like listen, accept, and select. Just about any code you find for unix/linux or even Windows, at this level, can be modified to work on NetOS. How you do certain things like blocking mode versus non-blocking might be different, but not much.