I am working on some video project where I have to do specific tasks, and one would be best described by combination of two filters: GausianBlur (0-100) and Shift Channels (A=Sat) applied to a colored layer with irregular contour and transparency (e.g. star mask on color gradient) and duplicate of this layer on top of it without GB and SC filters. This way I tried to extend edge pixels of top layer, but the higher I raised Blur's value, the less precise colors became on edges. I couldn't find any other solution than naively script something more precise myself.
My expression *tries* to read each pixel's RGB in image and its N-E-S-W neighbors and averages new RGB values. At this point everything must be working fine however AFX spits timeout error messages each time I want to evaluate the expression. There are two nested for-cycles for x and y axis and some imageSample() funcs.. thats it - doesn't work.

Even if I assume that this expression works, are there any ways to fill another layer pixel-by-pixel with resampled colors? AFX Help doesn't help.
This could be useful for sampling textures for 3D models (filling gaps between UV shells) and some colored matte choking to achieve after-keying aplicable or acid-ish effects.
Thank you in advance.