On the link to the code changes, should I interpret the green lines as lines to add and the red as lines to delete?
At the top of the page it has a legend with a green box that says 'added' and a pink box that says 'removed'. So yes if you do this in the appropriate places it should work.
I have applied the fix and currently it has worked on a demo site and a live site. I found I had to remove the existing FB links and redo them, so that may help others, but after that no problems at all and no neverending popup boxes asking me to make the connection available.