Use min/max functions defined in OpenCL language. You can also use ternary operators here.
I would suggest to write the 2 results (max and min) in different arrays, to have coalesced writes.
Also you can eliminate the IF at the start, and set the size of kernel domain according to the result data size.
So at every result position, gather four inputs at (x*2,y*2), (x*2+1,y*2), (x*2,y*2+1), (x*2+1,y*2+1) into temp variables, do the min/max-es on them as gautam.himanshu suggested, and write the results.
(on the HD7xxx I've found an instruction that gathers 2x2 pixel channels (one channel at a time) form a texture. It's some sort of reduced bilinear sampler. It's perfect for your task.)