Make different sketches that get each piece/concept working before having any serious thoughts about how they go together. What works may well be different than what you thought would work and that can change how it all fits, works and plays together well.
Work in steps and check compile often. Use Auto Format now and then, if your braces don't match up it will tell you. The -last- thing you want to do is throw up a pile of code and -then- run compile, you end up troubleshooting with many unknowns and their interactions and then what? You end up simplifying down to the stages you should have started with after going through more work. If you're stuck on the original overall structure, fitting the fixed pieces in "to save time" usually doesn't save time or fit well.
It's good to have an original plan but don't get too specific until you have the pieces. Always be ready to make changes and keep your eyes and mind open to discoveries along the way. Don't expect to be perfect, just keep getting better through practice and learn/adapt from everything that interests you.
I have no idea if there's some way to use this:
if(solenoid == 0 & timerClosed >= timeClosed)but that's not how to make something happen on time.
The BlinkWithoutDelay Example (in 02. Digital) in your IDE shows how. The example does use longs for 2 of the time variables. They should be unsigned long but unless you're going to have intervals over 23 days long it isn't an issue.
What blinks a led can flipp a switch. What reads a pot reads analog. Do tutorials.
I hope this helps.