Yeah. I wouldn't even mind learning weird syntax or grammar, like
Thread.sleep(5 * 60 * 1000); light.off();
Thread.sleep(5 * 60 * 1000); light.off();
Avoids reciting the steps you want and gives you reliability, but I suppose requires any 'variables' to be hardcoded (or for you to create multiple instances)