Replace window execScript call with script engine dispatch for return value access