Need some help in coding a "timer" in an if else statement
A flowchart is not bad, but it's not really the most appropriate kind of
diagram for this sort of problems. You should try to think in terms of
finite state machines instead, which is a very useful concept
whenever you try to implement “reactive” systems, i.e. systems that have
to react to some kind of input.

Here is your problem, as I understand it, translated into a state
diagram:



This system has two states:


“waiting”, when it waits for the first button to be pressed
“stand by” when the first button has been pressed and it waits for the
second.


Pressing button 1 makes a transition from “waiting” to “stand by”. The
transition back to the initial “waiting” state can be triggered by two
distinct events:


3 seconds spent in the “stand by” state
the user pressing button 2.


Note that in the second case, the system runs your code while making the
transition.

Once you have the state diagram, and assuming you have read (and
understood) the finite state machine tutorial I linked to, translating
the diagram into code is almost trivial.