Thank you all for the replies.
Actually what I want to achieve is a little more difficult...
Attached is the code in the loop() which should do the hard work.
The difficult thing with the LightBarrier is, that it's triggered physically for a second or so. So I'm not able to write my if statements with LightBarrier == HIGH and perform certain actions, as I want one output to be triggered for a second, and the second output for a longer time. As soon as the Barrier isn't triggered anymore, my code won't work anymore.
So I'm saving the trigger in the memory as in the code below, and with that number I tried to create all unique IF statements during day and night time.
So to give a short explanation of the goal:
-
daytime, LightSensor == HIGH --> triggering of the LightBarrier should set pin 8 HIGH for a second, PIN 9 (which is lightning) should stay LOW
-
as soon as it gets dark, PIN 9 should get high, triggered by LightSensor == LOW until 23:00. When the LightBarrier gets triggered output 8 should get HIGH for a second. PIN 9 should always be HIGH during this time.
-
between 23:00 and 6:00 the next day, the LightSensor is still LOW, PIN9 should get LOW. When the LightBarrier gets triggered, PIN 8 should get high for the time of the BarrierTimer, and PIN 9 should get HIGH for the LightningTimer
-
between 6:00 until daytime, same actions as in dot 2
I hope this makes sense. The code below is the last test which I did 10 minutes ago after some changes.
It seems that my Arduino is behaving strange now, triggering of the different sensors/timers now. Going to do more research, any help is appreciated
The first conclusion is though, that the scenario during daytime works correctly. When LightSensor == LOW the problems seem to occur. Maybe I'm making a mathematical mistake, or my IF statements are not unique...
BTW a last comment, I've replaced hour() for second() in my tests, as I don't want to run the test in cycles of 24 hours 
void loop() {
LightBarrier = digitalRead(switchPin);
LightSensor = digitalRead(switchPin2);
DigitalClockDisplay();
//alarm triggered, setting timers for barrier and light sensor
if (LightBarrier == HIGH) {
x = millis();
}
//alarm, situation day, from triggering LightBarrier up to end BarrierTimer
if (LightSensor == HIGH && x + BarrierTimer > millis() && x + LightTimer > millis()) {
digitalWrite(8,HIGH);
digitalWrite(9,LOW);
}
//alarm, situation day phase 2, between BarrierTimer and LightTimer
if (LightSensor == HIGH && x + BarrierTimer < millis() && x + LightTimer > millis()) {
digitalWrite(8,LOW);
digitalWrite(9,LOW);
}
//no alarm, situation dark, between 6:00 and 23:00 hour
if (LightSensor == LOW && second() >=6 && second() <23 && x + LightTimer < millis()) {
digitalWrite(8,LOW);
digitalWrite(9,HIGH);
}
//no alarm, situation dark, between 23:00 en 6:00 hour
if (LightSensor == LOW && (second() >= 23 || second() < 6) && x + LightTimer < millis()) {
digitalWrite(8,LOW);
digitalWrite(9,LOW);
}
//alarm, situation dark, between 6:00 and 23:00 hour
if (LightSensor == LOW && second() >=6 && second() <23 && x + BarrierTimer > millis() && x + LightTimer > millis()) {
digitalWrite(8,HIGH);
digitalWrite(9,HIGH);
}
//alarm, situation dark phase 2, between 6:00 and 23:00 hour
if (LightSensor == LOW && second() >=6 && second() <23 && x + BarrierTimer < millis() && x + LightTimer > millis()) {
digitalWrite(8,LOW);
digitalWrite(9,HIGH);
}
}