The best way to do this is to store a post_meta value in the entry itself that is then checked on this line to see if a redirect should or should not happen, and an option in the main blog's options table to check whether this should be active by default or not. (It should default to the same behavior before this patch, meaning it should be off by default.) That way Network Admins can turn on or off the redirect for each individual site in their Directory and can configure the default for new sites.
As discussed in https://github.com/fabacab/multisite-directory/pull/19#discussion_r92444139