Help with code and wiring it up

Hello! I am currently doing a project for my daughter - for the full story, kindly refer here. -

Being a newbie at this, I would like to request help on how to properly replace the LED in my project with a small vibration motor, both physically and in the code.

I am currently using this code successfully on my project -

And I saw this vibrating motor circuit, which I think will be ok to use with my project -

I now wish to replace the visible cue (which is the LED) with a sensory cue (vibrating motor) but I am unsure on how to go with wiring up the breadboard and tweaking the code as well.

Any help please? Thank you in advance.

As far as i can see all the information you need is presented in the links you gave. Replace the LEDstate variable with something more aptly named like MotorState. keep track on which output pin digitalWrite(outpin, MotorState) acts and connect the 1K resistor in the vibration motor circuit to that pin

If you need help on something specific please be specific.