In my BASIC interpreter and in my make utility I use source code
interpretation (when I started to write the BASIC interpreter I
expected to encounter BASIC programs with self modifying code. :-)
Therefore I used source code interpretation).

For source code interpretation you need functions to skip some code.
E.g.:
- Skip to next ELSE or ENDIF
- Skip to next ENDIF
Be careful:
This functions must check if an IF statement is encountered.
In this case they must call "Skip to next ENDIF"
recursively and continue skipping after the ENDIF.

Then you can essentially work as follows:
- When an IF is taken you can continue executing statements.
- When an IF is not taken you use "Skip to next ELSE or ENDIF"
and continue executing after the ELSE or ENDIF.
- When you approach an ELSE you use "Skip to next ENDIF"
and continue executing after the ENDIF.
- When you approach an ENDIF you can continue executing statements.

There are also corner cases, like what to do when the end of
a file is reached during the skipping.

If you have also ELSIF statements the situation becomes
more complicated, but it is also solveable.

If you are interested in the details:
The Bas7 interpreter is described here:http://seed7.sourceforge.net/scrshots/bas7.htm
There is a link to the source code in the top right area of the page.
The functions to skip code (regarding IF statements) are:
find_then
find_else
find_end_if
find_else_elseif_or_end_if

The functions will probably not fit to your interpreter, but you
might get some ideas from them.