Hallo Knacki!

Hab mal dein Code genommen und mit
2 For Next Schleifen versehen.
Ist jetzt schlanker und ich glaub noch übersichtlich.

Code:
$regfile = "m16def.dat"
Config Porta = Output
Dim I As Byte

Do

   For I = 0 To 7 Step 1  ' Schleifen-1-Anfang >>>  Porta von 0 bis 7 hochzählen
      Porta.i = 1              ' Schrittweite(Step) = 1
      Waitms 35
      Porta.i = 0
   Next I                       ' Schleifen-1-Ende


    For I = 6 To 1 Step -1   ' Schleifen-2-Anfang >>>  Porta von 6 bis 1 herunterzählen
      Porta.i = 1                  ' Schrittweite(Step) = -1
      Waitms 35
      Porta.i = 0
   Next I                               ' Schleifen-2-Ende



Loop
Vieleicht hilft dir das weiter.

mfg,MX3