Hello mateu,
What do you think detects if they right click the sign? An event is called when someone Interacts with air or a block in a plugin, when the event is called they detect which sign they right click and somehow get that server from the sign. My guess is they stored the sign's location with the value of the server. Now, they detect a player right clicking a sign, now they just have to detect if someone does a command and send them on their way. Again, I have knowledge and experience in this and it seems you do not, just trust me.
ProSl3nderMan