I assume, because it's the only way I can imagine it could work, the PLC is using a weak pull-up and strong pull-down, in other words an open collector and a pull-up resistor. The device it is communicating with should be the same, although a second pull-up might not be needed. This is the way many signalling methods use, such as i2c and 1-wire.
So to answer the OP's question, yes, you can change from INPUT or INPUT_PULLUP to OUTPUT in loop as needed. BUT take care never to set the Arduino pin to OUTPUT+HIGH because that could cause a short-circuit and a damaging large current to flow if the PLC is sending LOW.
I'm not sure about this, but there could be a danger that changing directly from INPUT_PULLUP to OUTPUT could result in sending HIGH and causing that short circuit. So maybe safer to avoid INPUT_PULLUP. Perhaps another forum member can confirm or deny that.
As a safety measure, you could put a current limiting resistor like 330R between the PLC output and the Arduino pin. Then if something goes wrong, it might not work but at least there will not be a short circut.