Using an ESP8266 in AP mode to control a blinking LED

if ( request.indexOf("LEDON") > 0 ) {
bool ledOn = true;
}

This code creates another local variable with the same name as your global variable, and as soon as you leave the if statement the variable is detroyed.
Variables are only valid within the {} they where created.

if ( request.indexOf("LEDON") > 0 ) {
ledOn = true;
}

The same is true for the other case.