Cycle between High and LOW signal every milliseconds for 6 seconds

tried adjusting the code following those samples you provided and still nothing happens. Not sure the issue.

const int solenoid = 10; //Output to solenoid relay
const int Step = 9; //Stepper motor driver pulse signal
const int step_dir = 8; //Low=CW High=CCW direction output to step driver
const int button = 7; //start button and Cylinder switch
const int cylswitch = 6; //cylinder switch
const int stepdirection = 5; //input for direction of stepper motor

int cylstate;
int buttonstate; //state of button high/low input from start button
int dirstate;  //state of stepper direction high/low input from directional switch
int stepstate; //state of stepper motor pulse
int solstate; //state of solenoid high/low 

long previousmillis = 0;
long interval = 6000;

void setup() {
pinMode(button, INPUT_PULLUP);
pinMode(stepdirection, INPUT_PULLUP);
pinMode(cylswitch, INPUT_PULLUP);
pinMode(solenoid,OUTPUT);
pinMode(step_dir,OUTPUT);
pinMode(Step,OUTPUT);
digitalWrite(step_dir,LOW);
digitalWrite(Step,LOW);
}

void loop() {

stepstate=digitalRead(stepdirection);
buttonstate=digitalRead(button);
cylstate=digitalRead(cylswitch);

if (stepstate==HIGH){
  dirstate=HIGH;} //when switch is on direction is CCW
 else{
  dirstate=LOW;} //when switch is off direction is CW

if (buttonstate==HIGH){
  solstate=HIGH;}//start button is pressed strobe is clamped activating cylswitch input
 else{
  solstate=LOW;} //start button is not pressed strobe is released

if((buttonstate==HIGH) && (cylstate==LOW)){
  unsigned long currentmillis=millis();
  if (currentmillis-previousmillis>interval){ //when air cylinder switch and start buttons are active turn on stepper motor for 6 seconds.
    previousmillis=currentmillis;
    if (digitalRead(Step)==LOW){
      digitalWrite(Step,HIGH);;
      delayMicroseconds(1);
      digitalWrite(Step,LOW);;
      delayMicroseconds(1);}}}


 digitalWrite(solenoid,solstate);
 digitalWrite(step_dir,dirstate);
 }