Compute shader loop in editor

I’m working on a tool for the editor in which you can take a sprite and it blurs it for you. I’m using a compute shader with buffer approach to blur it but blur requires multiple passes. After using Shader.Dispatch(), I’m trying to use Buffer.GetData() but this returns a black/empty texture because (I think) the buffer will only be done after a frame update which only happens in editor when you change something. I tried using corourines in the editor but that does not work. Using a non-buffer approach (RenderTexture & ReadPixels) only allows me to do one blur pass. Is there another way to Dispatch() and use the result of a compute shader in a loop in the editor?
Here’s the piece of code I written so far:

        SpriteRenderer sr = GetComponent<SpriteRenderer>();
        reftex = sr.sprite.texture;

        Color[] outputData = new Color[reftex.width * reftex.height];
        ComputeBuffer buffer = new ComputeBuffer(reftex.width * reftex.height, 16);
        Color[] bufferData = outputData;
        buffer.SetData(bufferData);

        int kernel = shader.FindKernel("CSMain");

        shader.SetTexture(kernel, "Input", reftex);
        shader.SetVector("TexelSize", new Vector4(1f / reftex.width, 1f / reftex.height, reftex.width, reftex.height));
        shader.SetBuffer(kernel, "Output", buffer);
        shader.Dispatch(kernel, buffer.count, 1, 1);
        //yield return new WaitForEndOfFrame();
        buffer.GetData(outputData);
        resultTexture.SetPixels(outputData);
        resultTexture.Apply();

The biggest problem was with the data structure I used for the output of the shader. By changing the output data type in the shader from RWTexture2D<float4> or RWTexture2D<float> to RWStructuredBuffer<float4> and programming the shader to return a one-dimensional array of float4, (also known as Array[id.x]) instead of an Array[id.xy], I could receive the result from the shader and transfer it into the a Color data structure (colorArray) in C#. Then I could assign the texture with Texture.SetPixels(colorArray). I would still love to know how to use the RWTexture2D data type so I can simply set the colors by doing Output[id.xy] = resultFloat4.

In conclusion: It seems that when you use compute buffers, you can not copy data from that buffer to a RWTexture2D data structure in the shader. But using compute buffers(in c#), (and in that extend RWStructuredBuffer in the shader) is the only way I know of, that enables me to use ComputeBuffer.GetData() to wait for the shader to finish.