Yes, you should edit it to change the field keys to match the field keys of the relationship fields you want to make 2 directional. If it’s the same field then put the same field key in both places, but remove the second add_filter() line.
The file I put on github is meant to be an example and there’s a lot of comments in it to explain what’s going on. I use the repo to post many examples of code for doing things in ACF.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users