In response to your second question, PxIN is fundamentally an input so you can’t write to it. It will tell you which pins on that port are currently high, either as a result of your outputs to PxOUT or from external inputs to the device.
Every port has PxDIR to set the input or output direction of the port, PxOUT to set the the port high or low(voltage wise), and PxIN to read the status of the input pins on the port(defined by PxDIR).