Proper Setup for Water Heater Gas and T&P Relief Valve
All backed up

The primary problem with your setup is that what you have right now is a sanitary hazard, as there is no air gap preventing sewage from backing up into the T&amp;P discharge line.  A standard water-softener or standpipe type air gap fitting can be used for this task, though, and is inexpensively available wherever plumbing supplies are sold.

The rest of the setup, though, is OK; the cellular core ABS pipe is fine since it's downstream of the standpipe, and discharging T&amp;P relief water to a standpipe via an air gap is an acceptable means of T&amp;P discharge, as per IRC P2804.6.1 point 5 which permits discharge of T&amp;P relief water to a "waste receptor", which by Code can be a hub drain, standpipe, floor/mop sink, or floor drain.