maybe you should use execute_async_script with marionetteScriptFinished to return the value?