No worries. Glad you're getting there.
Here's a fixed version of your capx. I've commented new additions.
Also, can't remember which layout it was - in game, or load - you had the Goto Layout before your code to reset the PlayedBeforeVar, so the reset was never going to work because it would jump to the new layout first.