You could probably do something like this
this.getWindow().setFlags(this.getWindow().getFlags() & ~WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
Did you look at the API? There's also this method
http://developer.android.com/reference/android/view/Window.html#clearFlags%28int%29
this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
I have not tried this either yet.
I imagine this will work to check if the flag is set:
this.getWindow().getFlags() & WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
Edit: As per the comments, apparently this is how you get the value of the flag.
this.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
There might be a method for that too, you should look at the API doc.