Some items don't have an on/off state so you need to test in other ways. The tutorial window you can test for its height and then close it if necessary:
I've used the numerical IDs here, partly because the tutorial window itself doesn't have a button path. You can find the numerical IDs for interface items by placing the cursor over the item and examining the Preferences>Utilities>View window id slider. I've also used 'IClick' rather than 'IPress'. For some actions this is a better option - generally when what is being clicked is not an ordinary button or switch - but a bit of trial and error is necessary.