Edit - Mutiple Square Waves on button presses

Im completly new to Arduino program and it seems even the simplist code is evading me. I cannot figure out a way to play a single SquareWave tone with playTone on a button press. So while the button is pressed down the tone is continous.

Any help would be wonderful.

Something like:

//while button is pressed
    //play tone at this index
    //increment index
//Arduino Sound Hello World
//Created by David Fowler of uCHobby.com

//Define the I/O pin we will use for our sound output
#define SOUNDOUT_PIN 9
int buttonPin = 6;
int newPin = 4;
int val = 0;
int val2 = 0;


void setup(void){
  //Set the sound out pin to output mode
  pinMode(SOUNDOUT_PIN,OUTPUT);
  pinMode(buttonPin,INPUT);
  pinMode(newPin,INPUT);
}

void loop(void){
  val = digitalRead(buttonPin);
  if (val == LOW) {
          //Generate sound by toggling the I/O pin High and Low
          //Generate a 1KHz tone. set the pin high for 500uS the low for 500uS to make the period 1ms or 1KHz.
          //Set the pin high and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,HIGH);
  delayMicroseconds(1000);
  //Set the pin low and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,LOW);
  delayMicroseconds(500);
  }
  
  
  val2 = digitalRead(newPin);
  if (val2 == LOW) {
          //Generate sound by toggling the I/O pin High and Low
          //Generate a 1KHz tone. set the pin high for 500uS the low for 500uS to make the period 1ms or 1KHz.
          //Set the pin high and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,HIGH);
  delayMicroseconds(1000);
  //Set the pin low and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,LOW);
  delayMicroseconds(2000);

  }
}

Managed to produce a tone on a button press, but now I have a new problem.

I have two buttons buttonPin and newPin

when i press the first one down it should play

void loop(void){
  val = digitalRead(buttonPin);
  if (val == LOW) {
          //Generate sound by toggling the I/O pin High and Low
          //Generate a 1KHz tone. set the pin high for 500uS the low for 500uS to make the period 1ms or 1KHz.
          //Set the pin high and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,HIGH);
  delayMicroseconds(1000);
  //Set the pin low and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,LOW);
  delayMicroseconds(500);
  }

and the second button plays

val2 = digitalRead(newPin);
  if (val2 == LOW) {
          //Generate sound by toggling the I/O pin High and Low
          //Generate a 1KHz tone. set the pin high for 500uS the low for 500uS to make the period 1ms or 1KHz.
          //Set the pin high and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,HIGH);
  delayMicroseconds(1000);
  //Set the pin low and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,LOW);
  delayMicroseconds(2000);

Can the arduino support two button presses doing diffrent things. Or have i mucked up the coding?