would that service id work on all computers that the script is run?
or is that unique by computer?
Service IDs are unique per computer, so that's not going to work on any other system.
is so, how can i make it universal?
Well, don't use ID 🙂.
If you want a script that will work on ANY machine then you have a problem since there is no persistent identifier. You can reference any service by a number of parameters (e.g. ID, name, index value, etc.) but there's no guarantee that any value will be the same on any other machine - even the 'name' may be different, and the index value may be different depending on how many accounts the user has setup.
i can not get it to work by naming my service "iCloud" only.
Is that the name of your service? I'm guessing not. Amend my earlier script to 'get name of every service' if you want to see the names you can use. This still may not be consistent across machines, though.
i did noticed that when using messages, the conversation has to be started already in order for the "buddy" to be recognized
That shouldn't be the case. Is the remote user in question in your buddy list? If he isn't then you can't reference a buddy by name since he doesn't exist on your system until a conversation is in progress. If a buddy is in your buddy list then you should be able to reference them by name without an active conversation.