Someone else gave you the answer, but the code can be changed to:
For n=1 to 100
*--lots of code
if not n=50
*--lots of code
if not x=20
*--lots of code
endif
endif
Endfor
Of course, some people will not like the readibility of this, others will preferr this, etc. I do not want to enter in polemics of which way is better, just providing an alternative
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges