Loop/do while/ not sure how to proceed

It sounds a lot like you want to do something when a condition becomes true, not if a condition is true. Check out the State Change detection example in the IDE (File->examples->02.digital->State Change Detection) to learn how to accomplish this.