The pins becoming analog is nothing to do with how they connect to AG or AMUXBUS. The pin becomes analog when the driver on it and input buffer are removed from pin and it is made high Z. The pin connects to all the analog resources of PSoC through AG and AMUXBUS. AG and AMUXBUS are analog buses. There are total 16 AGs in the device four each quadrant of the device. And two AMUXBUS's one left and one right. Each pin can connect to one AG and one AMUXBUS. For example, pin P0.0 connects to AGL 4 and AMUXBUS-L.
Now, when you want to use four pins of Port 4 as analog, make those pins as analog pin in the pin component and nothing else. According to what signal is connected to these pins the PSoC Creator will connect these pins to either AG or AMUXBUS and route it and you don't need to do anything. If you want to manually manipulate the routing then write Port4_AG and Port_AMUXBUS in the code. So whenever the bit is set in Port4_AG, that particular pin of the port will connect to its AG. For example, Port4_AG=0x01 then pin P4.0 will be connected to its AG which is AGL4, If Port4_AG=0x80 then pin P4.7 connects to its AG which is AGL7. Similarly, when any bit is set in Port4_AMUXBUS register then that particular pin will be connected to AMUXBUS of its side, either AMUXBUS-Left or AMUXBUS-Right. For example, if Port_AMUXBUS=0x04 then pin P4.3 will connect to AMUXBUS of the same side which is AMUXBUS-L. The port 4 is on the left side so all the pins of the port 4 can connect to AMUXBUS-L.