Add these to your code if testing these conditions is helpful to your program. I've seen a lot of people asking for help with what looks like random behavior in their projects, and mostly it is due to not reinitializing all their variables. This can tell you if they're running the program with clean data or not.
This is the released version. The development version is at http://scratch.mit.edu/projects/32620096/ and is likely to be broken or under test at any random time. Use this one to take code for your projects. I was quite pleased at discovering a way to reliably detect which green flag was pressed :-) (mouse down vs up immediately after clicking it) Be careful when using this in your code to delete all the variables immediately prior to saving the project. (Except the cloud variable, which needs special handling - see notes inside. Trick learned from DadOfMrLog)