How can I check the returned boolean of a function?
The way you are doing it in the second block is not what you think you are doing.  The line 

if target is True:


will ask if a function reference is the same as a literal True...which it is not.  You want to invoke the function, so use the parenthesis and pass in the string you want.
If the parameter "context" is the one you are interested in comparing (if you are using BPY, it isn't, heads up), it will instead be:

if target(context):


Notice I drop the is True", if is doing that for you already, you don't need to do it again.