Well, an unexpected $end is most likely a missing bracket. I'm a little concerned about
uploaded in binary mode (as required),
PHP scripts are by nature text files, that's all they are, and it's possible binary mode has done something funky with the line returns. Used to have this problem all the time with Perl scripts, and editors that are not Unix compatible.
Have you tried re-uploading it using ASCII?
Another possibility is something is screwy in your upload, for example, the file didn't transfer completely and is cut off at the end. You can play around with Passive/Active mode in your FTP, and if you have a way, view the file actually on the server via SSH or maybe even a cPanel file manager.
Last is if you've edited anything, do NOT use MS Word or any rich editor for this, it will convert your quotes to smart quotes and really hose you up. Edit the originals in something like NotePad (or SimpleText for Mac.)
edit: Heh. Curious I ran this script and look at line 1446:
$options['tag_attributes'] = str_replace(array('"',
'''), array('"', "'"), $options['tag_attributes']);
See the three single quotes in a line? I got an error there (not a $end error.) Note usre of this line's intention but if it's trying to remove (don't think so) it would be
$options['tag_attributes'] = str_replace(array('"', ''), array('"', "'"), $options['tag_attributes']);
or if it means to replace them it would be
$options['tag_attributes'] = str_replace(array('"', "'"), array('"', "'"), $options['tag_attributes']);
or
$options['tag_attributes'] = str_replace(array('"', '\''), array('"', "'"), $options['tag_attributes']);
In any case, three in a row is an error.