creating a square-wave signal - doesn't work

Hey,
I have a question about my sketch, creating a square-wave signal from 8kH (125µs) up to 20kH (50µs) and a secound 90° phase-shifted.
When I programm the sketch with a constant frequence it works, but not when I use a Potentiometer.

int Red=13;
int Green=12;
int statRed=LOW;
int statGreen=HIGH;
unsigned long previousMicro=0;
unsigned long previousMicro2=0;
unsigned long currentMicro=micros();
unsigned long interval;
unsigned long wait=interval/2;
int sensorPin = A1;
int sensorValue;
int sensorMin=0;
int sensorMax=1023;


void setup()
{
  pinMode(Red,OUTPUT);
  pinMode(Green,OUTPUT);
  //Serial.begin(9600);
}

void loop()
{
  unsigned long currentMicro=micros();

  sensorValue = analogRead(sensorPin);
  sensorValue = map (sensorValue, sensorMin, sensorMax, 125, 50);
  interval=sensorValue;

  //Serial.println(interval);


  if(currentMicro-previousMicro>interval)
  {
    previousMicro=currentMicro;

    if(statRed==LOW)
    {
      statRed=HIGH;
      digitalWrite(Red,statRed);
    }
    else
    {
      statRed=LOW;
      digitalWrite(Red,statRed);
    }
  }
  if(currentMicro-previousMicro2>interval)
  {
    previousMicro2=currentMicro;

    if (currentMicro=wait)
    {

      if(statGreen==LOW)
      {
        delay(wait);
        statGreen=HIGH;
        digitalWrite(Green,statGreen);
      }
      else
      {
        delay(wait);
        statGreen=LOW;
        digitalWrite(Green,statGreen);
      }
    }
  }
}

So my question is, why is there only one square-wave signal (on pin 13) and not two??

An analogRead take over 100us.
You could use the "conversion complete" interrupt instead of a busy-wait.

So my question is, why is there only one square-wave signal (on pin 13) and not two??

In my view of a square wave, the value being plotted is either HIGH or LOW. The points are connected by lines to create the plot.

Since a pin can either be HIGH or LOW, a plot of the state of the pin over time will be a square wave.

There is no possible way to create two square waves on one pin.

You are right, but there are actually two Pins: 12 and 13 ...
8)

You are right, but there are actually two Pins: 12 and 13 ...

Are you expecting a square wave on each pin? What do you get. I'm not all that fond of guessing games.

I get a square wave on pin 13 and somthing weird on 12.
But I think it's because the Poteniometer needs about 100 µs to talk to the board so I need an Interrupt

why is there only one square-wave signal (on pin 13) and not two??

Because you are going about it all wrong.
The pot reading will give you the basic delay. This should be one quarter of the square wave period.
Then at the end of each basic delay you need to change pin 13 and 12 to give you your quadrature signal.

First delay set pin 13 high
Second delay set pin 12 high
Third delay set pin 13 low
Fourth delay set pin 12 low

Of course you do not use delays but the blink without delay technique. That way the analogue read will be mainly factored out. Do only one analogue read per cycle.