You seem to be looking for a "where clause" for each cell, and want to include only the right subset in each cell. GTL does not support such where clauses in the syntax, as it essentially duplicates this feature from SAS data step. So, your first approach is the right one. The "IF" conditional syntax in GTL is not designed for this.
Alternatively, you can use classification panels with the concatenated data, as long as the two sets are classified using another colunn. You can create a classification panel using DATALATTICE or a DATAPANEL. As long as the plots in each cell are identical, and use the simple plots such as ScatterPlot, SeriesPlot, BarChart, etc, you can do this. This is defined in the embedded LAYOUT PROTOTYPE.
You will need to assign another classifier variable (say TYPE) for the two different set of observations. In LAYOUT DATAPANEL use classvars=(type). If values for type are "MEAN" and "MEDIAN" you will get two cells with the subsets of the data. Each cell will have a cell header automatically, with the class value in it. If the cells are stacked (two rows, 1 column) the X axis will be uniform. If you don't want this, then the lattice structure should be 1 row, 2 columns.
You can probably use PROC SGPANEL to do this. SGPANEL is preferred as it will allow you to use all plot statements in the prototype, and the syntax will be very simple:
proc sgpanel data=data;
panelby type / columns=2;
series x= y= / options;
refline < options >
rowaxis < options >;
colaxis < options >
run;