Unfortunately conditional logic like this isn't supported in JEQL at this point.
This was originally by design, in order to keep the language simple and declaritive - but I agree that it would be very nice to have in some situations. It's fairly easy to add - probably the best thing is just to add it, and not worry too much about theoretical purity!
A short term workaround might be to write the shapefile, and then delete it if it's empty. This can be done using the System.exec("<cmd string>") function, in conjunction with the conditional expression. Somthing like this:
fed_count <= 0 ? System.exec("delete federal.shp") : 1;
fed_count <= 0 ? System.exec("delete federal.dbf") : 1;
fed_count <= 0 ? System.exec("delete federal.shx") : 1;
Yes, this is a hack - but maybe at least convenient.
I'll start thinking about adding the capability for if-else logic....