Somehow you need to create a mask defining where the text is. Once you got that, blur the entire image, and blur the mask also. Then get the new larger mask and assign the blurred image to the original image in the blurred mask. In short, something like
kernel = ones(windowSize, windowSize) / windowSize^2;
blurredImage = conv2(double(grayimage), kernel, 'same');
blurredMask = conv2(double(mask), kernel, 'same');
newMask = blurredMask > 0;
grayImage(newMask) = blurredImage(newMask);
It would be easier to simply erase the image in the mask than to blur the text and replace it.