I'd normally use an array to set this up, as it has tools to make this sort of thing easier, but let's go with what you've got.
First you'll need to identify if a grid spot is valid. You've already set up an instance boolean "filled" for your grid object, so that's good.
Now when you press a direction, you want to see if the next spot in that direction is "filled" or not. You can easily do that with a compare instance variable condition.
If it isn't filled, check the next position over in the same direction and repeat until one is filled.
This can be done in a loop. Repeat x times (where x is the width of your grid, or maximum number of spaces you can move), and multiply the offset by loopindex for your positional check. If you run into a filled grid object, stop loop and move the selection to that object. Otherwise, if no valid spots were encountered, nothing happens.