Have a rotational command system, and get environment events. In the morning, all prisoners wake up to eat at the mess hall and shower, morning time they either go to labor or they go to common area, which has a guard tower or some kind of overlook (consider guards being able to spend $ to be in sniper tower, as threat level increases rifles get bigger, .22 rifle, 5.56 rifle, 7.62 rifle), lunch time, a second period of free time, dinner and then sleep.
Each period of time would last about 3 minutes. With the use of relays and a brick timer you can create a very simple clock system. You also asked about how to randomize a variable, so I'll get to that too.
I'll explain each further below-
Randomizing a Variable with VCE:
1 [ ] onRelay Self VCESetVariable [rand] [1]
2 [1000] onRelay Self VCEModVariable [rand] [5*] [randomize]
3 [ ] onVariableUpdate self VCEifVariable [rand] [==] [1] [4-5]
4 [ ] onVariableTrue NamedBrick1** fireRelay
5 [ ] onVariableFalse self VCEifVariable [rand] [==] [2] [6-7]
6 [ ] onVariableTrue NamedBrick2** fireRelay
7 [ ] onVariableFalse self VCEifVariable [rand] [==] [3] [8-9]
8...
9..
10.
---------------
**The reason I put NamedBrick# is so you can fire the relay to another brick that would control each scenario.
*The 5 would pick a number between 1 and 5. 5 different outcomes.
Event-Driven time cycle:
1 [30000] onRelay Self fireRelay
2 [] onMinigameReset Self VCEsetVariable [Time] [0]
3 [] onRelay Self VCEmodVariable [Time] [+] [1]
4 [] onVariableUpdate Self VCEifVariable [Time] [==] [0] [5 5]
5 [] onVariableTrue miniGame CenterPrintAll [Everyone up! Mess hall is open for one hour!] [5]
6 [] onVariableUpdate Self VCEifVariable [Time] [==] [6] [7 7]
7 [] onVariableTrue miniGame CenterPrintAll [Chow times over! Mess hall is closed until lunch!] [5]
8 [] onVariableUpdate Self VCEifVariable [Time] [==] [12] [9 9]
9...
10..
11.
? [] onVariableUpdate Self VCEifVariable [Time] [==] [ 54 ] [? ?]
? [] onVariableTrue Self VCESetVariable [Time] [==] [ 0 ] [ ]
Still adding more to this ^^^ WIP
These events assume that each period of time is 3 minutes IRL, there's breakfast, common period, lunch, common period, dinner, bed. Lights out accounts for 3 periods, so in total that's 9 periods, 9*3 = 27 minutes to complete the cycles.
When you want certain things to change like prison lighting and stuff like that automatically, just include another "onVariableTrue," and make sure the box at the end of your if-then statements is numbered correctly
I might start building my own prison project... Dunno how far I could get.