Automatic network switching at a specific time


I have a Macbook Pro and a Time Capsule. The Time capsule is not connected to the internet, and I am using it only for Time Machine. My Macbook, in the other hand is connected to the internet network from a neighbour. Now. Here comes my question:

Is possible to create a script that tell my Mac to switch automatically at 11 pm every day from the “internet network” to the “time capsule network” to perform during the night the backups? And then switch off the next day at 7 am again to the “internet network”?

Such a script will be amazing, because doing manually takes time, and I forget to do so every day.

Do you have any ideas how to perform this?

Thank you very much!