Touchless lightswitch with Raspberry Pi
MeasureDistance. The way it is written, sometimes it measures the duration of the signal, sometimes the (desired) time for the echo to arrive (consider what happens if you enter the first while loop). Suggestion:

def MeasureDistance():
    StartTime = time.time()
    GPIO.output(GPIOTrigger, True)
    while GPIO.input(GPIOEcho) == 0:
        pass
    # Found the raising front
    StopTime = time.time()
    GPIO.output(GPIOTrigger, False)


Of course, if the echo arrives faster than the code executes (and Python is slow), you'd get the elapsed time 0. I suppose there's nothing you can do about that, other than resorting to interrupts. Also, you may want to put some safeguards (a timer maybe) in case the raising front never arrives.

main. I don't see the need to import subprocess in the middle of the code. Also, state variables tend to create an unmaintainable code. Suggestion:

    try:
        Distance = MeasureDistance()
        while True:
            while Distance &gt; 10.0:
                Distance = MeasureDistance()
                wait(5)
            switch_on()
            while Distance &lt; 10.0:
                Distance = MeasureDistance()
                wait(5)
            switch_off()
    except KeyboardInterrupt:


PS: a magic 34300 constant must go. Give it a nice symbolic name (yes we all know it has something to do with the speed of sound).

Update.
Usually in the situations like yours you may have a funny behaviour at the breaking distance. Due to random factors (like the code execution time, and many more others) the distance is measured with a certain error, and the switch will go on and off unpredictably. To deal with it, allow for a hysteresis:

            while Distance &gt; breaking_distance - tolerance:
                Distance = MeasureDistance()
                wait(5)
            switch_on()
            while Distance &lt; breaking_distance + tolerance:
                Distance = MeasureDistance()
                wait(5)
            switch_off()