You can find a lot of good tutorials in Google about "Bash scripting". You can play with the Internal-API to do whatever you want or customize the standard Webinoly behavior, you can execute any code/script you want after some exact events in Webinoly, for example, at the beginning of the "site" command.
Just check (if) for the event you want and execute any code want after that, it's just as simple as that.