Need little help with this code

caslor:
i have the extra copies because every scope(function) have to check always the same thing..

I know you need to check but you don't need to do it the way you are doing it. The single check at the top of loop() is sufficient.

maybe if use the ''goto'' method i can do that... i will try it

Consider GOTO forbidden unless you are a sufficiently good programmer not to need help from anyone here. When you are that good you will realize that you don't need it.

Have look at the code in Several things at a time. Note how each function runs very briefly and returns to loop() so the next one can be called. And there may be dozens of calls to a function before it is actually time for it to do anything.

The tutorial Planning and Implementing a Program is an extended example of the same approach.

...R