To make the script execute when Adium starts up:
Create and save an AppleScript with the following code:
tell application "Adium"
Edit appropriately and save it wherever you like.
With Adium in as the frontmost application, choose Adium > Preferences...
Select the "Events" toolbar item in the Preferences window.
Find and select the "New email notification" event in the list of events.
Click the "+" button to add a new action to the "You connect" event.
From the Action popup menu, choose "Run an AppleScript".
Click the "Browse" button and choose the script you just saved.
Restart Adium and see if it works