Hi everyone!

You are probably better using a logic level Fet, or even a standard n-channel and totem pole driver, as opposed to a Darlington BJT.
A ULN203A for example is an array of 7 Darlington drivers with bias and current limit resistors built in and is designed to operate from a 5v locic signal (TTL)

Having said that your design premise is not great id you want to accurately dispense a specific quantity of liquid.

  1. The pressure and viscosity of the liquid will alter the flow rate even if the solenoid operation is consistent.
    To be accurate you need some form of positive displacement device, even an optic on a bar works this way.
    The metering container fills when the optic is not depressed and then completely emptys when it is.
    You can only ever get 1 shot assuming that the optic was full to start with. There is control feedback in the system, the operator, who visually checks that the optic is full before starting the sequence.
    vending machines use positive displacement pumps running at a known speed or rotating cups and screews to do the same thing, the ones that don't regularly over-fill or under-fill containers or put in the wrong amount of sugar or milk.

  2. If you leave your finger on the button for the whole dispense time then a second dispense cycle will start as soon as the first one finishes.
    To address this you need to look for edges that is a transition from low to high, a positive or rising edge, or high to low, a negative or falling edge.
    When you see an edge, your button is n longer in the state that it was, you act.
    You can do this in the loop, it doesn't have to be an interrupt or anything complex.
    However this brings its own problems that need to be handled ... see 3.

  3. You need to de-bounce the switches ...
    Mechanical switches are almost never clean, they bounce when pressed or released, turning on and off rapidly for a short transitional period between open and closed.
    If the glass was in place and the dispense switch was released after the delay was done you would be very likely to see a high on the digital read long enough to trigger a second cycle.

I appreciate that this is perhaps a little complex for a first dabble into uP programming but they are core concepts that are best learned soon.
If you have an LED that is lit when you press a switch it is perhaps overkill to worry about some imperceptible flashing but for anything else it is pretty much a prerequisite of using a switch.

There are literally thousands of Arduino tutorials on YouTube but this guy starts with connect it and works up, lesson 2 is buttons and de-bouncing.
It is quite watch-able with video of him writing the code and explaining why and how as he go's.

(No connection to me I just thought as getting started vids they were well done, I am sure that there are many other good presentations.)