So, it looks like what you need is some 2d array that stores the value of each 'cell'. (reading a texture/image is slow and painful). Then I would write two functions: a FindContiguousBlockScore(X, Y) function that gives me the score for a block of like cells based on the XY co-oridnate of the cell that was clicked in the array. If the score is greater than whatever the minimum score is for a 1x3 or whatever, then I would increment the score by the returned amount before doing something like a EraseContiguousBlock(X, Y) to delete the cells that were just 'cashed in'.

Then all that remains is the comparatively simple matter of shifting the cells above it downwards and filling the rest with random values.