Run script at sunrise time
Run a script at start-up or login. Within the script, run a check to see if sunrise has recently occurred. If so, perform the iTunes script.

Your script needs to determine how long ago sunrise occurred. If the time since sunrise is short enough, run the script. Short enough might be five minutes ago; it is unlikely a Mac is restarted within five minutes of powering on.

Powering on a Mac can take seconds to minutes. Checking the time since sunrise also helps compensate for this unknown delay.

How Power Manager solves this problem

In Power Manager, which can both power on your Mac at sunrise and run the script, we divide this type of problem into two sections: the trigger and the action.

The trigger schedules the Mac to power on at sunrise. For that, we calculate sunrise time locally and enqueue an IOPMQueue event. This is similar to your web site query and pmset call.

The action performs the script. In this case, Power Manager would check at each power on event to see if the expected sunrise had recently occurred. If so, the script would be run. Within Power Manager, this sensitivity is called drift.