In theory yes, but we don't know what the compiler does each time it structures/converts a serial.print statement, for example when it converts Serial.begin(xxx) that fore sure will have setup TXD as an output, but I doubt it will keep repeating that requirement and just assume the TXD pin is still an output. Then in this example, that issue could be solved by returning the pin state back to an output just after the one-wire device read, but to be honest, when the programme is running and debugging is finished the TXD/RXD pins are unused/redundant so why not use them.