Is there a code or command for this?

Generally digital pin 0 and 1 are used for communication with the host for reprogramming or serial monitor, and generally a bad idea to re-purpose them while testing and debugging. As it may cause interference and prevent the host from uploading new sketch.

Is there a way for the chip to check during "void setup()" section to see if there's something on those 2 pins that may indicate hosts wants to speak? If there's nothing, switch them to output mode and run void loop() as normal. If there's something trying to speak, set them to proper I/O mode and not go on to the loop section of the sketch?

I am testing something on a breadboard to get ATMega328p to run without the shield, and using Uno shield for uploading sketches and I don't want to end up with a chip that has flawed script and won't "listen" for revised script.

The time where the board needs thos pins to upload a new sketch is way before setup() ever gets called. It all happens during the bootloader. Your code doesn't need to worry at all about how it uses those pins. The reason using those pins can cause problems uploading code isn't becuase of the code on the chip, it would be because of any hardware attached to those pins.

For example, I use a serial LCD a lot that connects to pins 0 and 1. But to upload any new sketch, I usually have to unplug that LCD temporarily while the sketch uploads and then hook it back up when I'm done. But my code doesn't need to think about it at all. As far as my code is concerned, the LCD is always there.

Ah TY then. Since the chip is completely removed from my project to Uno for reprogramming, I guess I don't need to worry about making the chip "deaf" to future recoding.