My late-2013 Macbook Pro has recently started similar behavior. Somewhat randomly the screen will go black, sit like that for a while, then fans speed up for maybe 10 seconds then it eventually turns off. This whole cycle is something like 20 seconds.
Is this similar to what you observed which was fixed in your case by the script?