@DBRR_BrianK, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project
See About the IDE 1.x category.
I doubt that
What is more likely to happen is that loop3() overrides the DCC. In loop3() you unconditionally write the state to the pin, regardless if the button is pressed or not. So if the DCC code sets the output e.g. HIGH but state equals LOW (and button did not become pressed), you override the DCC.
The solution is probably (I can't test it) to only update the pin in loop3() when the button becomes pressed.
Note:
On AVR based boards (like te Nano), you can read back the state of a pin with digitalRead(). This might be useful if e.g. the DCC code sets the pin HIGH and you want to manually toggle it back.