Forget that, you are missing an open { on line 72, the first link in your function
if ($post->post_type == 'sp-event')
change it to
if ($post->post_type == 'sp-event') {
This is really basic debugging stuff. There is an unexpected } which means that something before that point is missing. You need to figure out what’s missing.