Looks pretty cool. I know this isn't the point but I feel like from a games perspective the scoring is a bit off. I don't think 1 extra second and 1 extra move should be the same value. For me to sit there and analyze what the optimal move set would be to move set would be to move a certain block may avoid 2-3 extra moves, but would take way longer than 3 seconds for me to calculate in my head. Maybe make a move add 5 points to the score?
I wonder if there's a game theory way to find the optimal amount that the moves and time should be weighed to make them equal value.
Either way, pretty awesome you got this working in bash.