On my friends and my server, we have a skyblock map. My issue is when somebody joins they spawn above the Void. What I need is for a command block to determine if a player is near the Void and send a redstone signal to another command block that will teleport them to the main island.
You can make a redstone clock (I recommend the repeater ones) and attach it to a command block with this command:
/spawnpoint @a X Y Z
Remember to turn off command block output to prevent spam!
/gamerule doCommandBlockOutput false
Hope it helped. :)
Why not just get the Essentials plugin and set the spawn somewhere else? You can use the /setspawn command. This is, of course, assuming you're using Bukkit.