If I want a script triggered on server1 and then run on server 2 is this the correct way?

Code:
on *:TEXT:*:#channel: {
  if ($1 == !cmd) {
    msg $chan attempting to run command on server 2
    /scon 2
    ; run commands on server 2 where $me matches nick on server2 not server1
  return
  }

is this the correct way? do I have to consider any other issues when using scon? when to use scon and when to use scid?

also I have server1 as the first server in my mirc and server 2 as the 2nd one but if I gave this script to someone else who has the servers in a different order/position how to determine the scon id of the correct server in the script rather than manually editing the id?