Problem with Code Blocks - Error EOF Expected

I’ve just opened up a script I was working on about 12 months ago to find that several of my code blocks no longer function and quite honestly I’ve no idea why, can anyone advise?

2017-11-07_17-17-36

2017-11-07_17-31-41

Apologies - should have looked harder!! solution below