Ok, explanation time...
The system works on 2 script blocks looping, one that is 3 blocks above you, the other is 8 blocks below you (these numbers can be modified by changing the y coordinates in all the the coordinates). The top one is written with segments like so:
IsDistance [rel:5,-4,0] [<] 
// The first coordinate is detecting 4 blocks below the script block and 5 in the +x. The second number set detects whether your are 4 blocks less than the first coordinate set.
IsDistance [rel:0,-5,0] [>] 
// This makes sure you are greater than 2 blocks or greater from the script block.
SetPower [rel:0,-12,0] [on]
// This sets power to the 2nd script block that is below the first script block.
MoveBlock [rel:0,0,0] [rel:1,0,0]
// This moves the top script block towards you
MoveBlock [rel:0,-12,0] [rel:1,-12,0]
// This moves the below script block towards you.
The bottom script block is written like so:
SetPower [rel:0,0,0] [off]
// Below we are powering and then powering off the possible coordinates that the top script block could be located
SetPower [rel:-1,12,0] [on]
SetPower [rel:-1,12,0] [off]
SetPower [rel:1,12,0] [on]
SetPower [rel:1,12,0] [off]