Lots of good questions here. Although the tank is pretty old, there is no point replacing it until it begins to leak, and it could last for years. Unless local/state codes require solid connections, the easiest way to connect water lines is with flex copper. If those are black iron nipples, they should not have been used in the first place. replace with brass then the copper flex to the shut off valves. The valve on the top of the tank is call a Temperature/Pressure relief valve (T/P). Its purpose is to open if either the temperature or the pressure inside the heater gets too high. Without this valve, the tank can literally explode. A thermal expansion tank is sort of related to the T/P, but may or may not be needed in your home. When your water heater kicks on and heats water, this causes expansion. Water does not compress, so this expansion has to go somewhere. In many homes, this expansion is absorbed by the city water main. However, it is becoming increasingly common for the city water pressure to be too high. (above 80 psi) To control this, a Pressure Reducing Valve (PRV) is installed. Inside this PRV is a check valve which prevents the expansion from passing into the city main. This in turn causes the pressure in the water heater to rise quickly and dramatically. Sometimes a faulty toilet fill valve will open are relieve the pressure, but otherwise it is the T/P that opens to handle the expansion. It is not a huge amount of water that is released, but it still can cause a mess. Also, sometimes the T/P gets corroded a bit and will not close tightly after the pressure is relieved. This can be a big problem. The solutions for this is a thermal expansion tank that is placed in the cold water supply line between the water heater and the PRV. It should be noted that some new water meters now have a check valve built in to assure that water from the home can not get back into the supply, and some newer PRVs have a bypass to allow expansion to bypass. Most of them, a PRV means you need an expansion tank. I notice the pipe from the T/P is just a short length of PVC. This pipe is supposed to be either CPVC, copper or steel and be elbowed down to about 6" from the floor. It can not be plumbed solidly into a drain. A floor drain is ideal for this drain. It might be possible to use that AC drain, but I'm not clear on just how that could be connected. Neither the heater nor the AC should be solidly plumbed into a drain.