Some simple logic for a rectangle fill tool might go like this...
You'll need at least two points for inputs, those would be the corners of your rectangle. You could use the mouse coordinates on mouse clicked and on mouse released.
Translate these coordinates to your tilemap tile values.
Then you're going to run two for loop, for min(x1,x2) to max(x1,x2) and for min(y1,y2) to max(y1,y2), to set each tile within these bounds to the proper tile.