ComputerCraft is great for a lot of things, but you could achieve this with just a vanilla day light sensor
If you'd still like to try it this way, there are a few things you need to fix.
RootSlayer's suggestions were good, but there's one more thing.
Here is your code, fixed, with explanations:
while true do
if rs.testBundledInput("bottom", colors.red) == false then --# This way, it checks every time the loop runs
print("Night Time")
rs.setBundledOutput("bottom",colors.yellow) --# See below for expalaination
else
print "Nope"
end --# Closes the if-statement
sleep(4) --# Pauses on this line for 4 seconds - Otherwise it would run the loop every game tick, 20 times a second!
end --# Closes the while-statement
rs.setBundledOutput() takes two arguments: side,output
The side is the side of the computer (its case sensitive):
"top", "bottom", "left", "right", "front", "back"
The output determines the colors that will be on:
Remember, 1 is white, 2 is orange, 4 is magenta, and so on.
So 'colors.white' is ONLY white (So it sets it to 1)
If you want white AND orange, its 3 (white + orange = 1+2 = 3)
If you want it to be just yellow, you do 'colors.yellow'.
You don't need 'true' (like rs.setOutput() does)