I've run into this before. My solution was to find port handles and reconnect. I'm not sure if there is an easier way.
Here's a function that should do the trick:
portHandles = get_param(blockHandle,'PortHandles');
sys = get_param(blockHandle,'Parent');
srcSignal = get_param(portHandles.Inport,'Line');
srcPort = get_param(srcSignal,'SrcPortHandle');
destSignal = get_param(portHandles.Outport,'Line');
destPort = get_param(destSignal,'DstPortHandle');
Note that this only works for single input, single output blocks, but I'm sure you could see how you would extend it further.