The easiest way to do this is via Applescript. The commands you need are both single line. To make Adium go online the Applescript code is:
tell application "Adium" to go online
To make it go invisible, the Applescript code is:
tell application "Adium" to go invisible
Pretty simple. You can also tell Adium to
go away. Open the Applescript Editor App in your /Applications/Utilities directory and create two Applescript files; one has just the command to go online and the other the command to go invisible/away. Save them as .scpt files with appropriate names.
That was the easy part. The next question is how do you trigger the right script at the right time? You essentially need to create the following two scheduled tasks:
"run adium_invisible.scpt at 5pm everyday"
"run adium_online.scpt at 8am everyday"
The default way to do this, built into OS X, is to use the UNIX 'cron' daemon. It's documentation can be found here. If you find the cron interface intimidating, there is a GUI app you can use to set tasks up, called Cronnix.
You'll still need to understand the timing syntax that crontab files use though. Wikipedia can get you up speed on that. Inside your user crontab you want to create two scheduled tasks. They should look like this:
0 8 * * * osascript path/to/adium_online.scpt
0 17 * * * osascript path/to/adium_invisible.scpt
osascript is an Apple specific command that lets the shell call and run an Applescript. You give it the path to the .scpt file as a paramater. Once you have the two cron tasks set up you should be good to go.
If editing the crontab file by hand, and not using Cronnix, don't copy and paste these verbatim, as tabs are required between the hours, minutes, days etc., not spaces as I have here.
Also, you could create cron tasks that use osascript and pass the Applescript directly like this:
osascript -e 'tell application "Adium" to go online'
However, storing the Applescript commands in a separate file gives you flexibility in the likely event that you need to change what commands get run later on. You can add to or remove from the .scpt files without needing to interfere with the crontab file.