BGE double tap to run
Think about the design of such a system. 

Requirements


key pressed once -> start timer AND wait for second key press
key pressed a second time AND wait for second key press -> do operation AND stop timer
timer exceeds -> stop timer


(I guess this is what you want to achieve. If you want something else let me know).

Design

This can be easily achieved via logic bricks. There is no point where you need Python. 

Lets break down the requirements.

Sensing a key press

is simple: keyboard sensor

Running a timer

there are several options such as 


delay sensor
timer property with property sensor
property with property actuator and property sensor


The timer property gives the time in seconds while the other options use number of frames. 

Wait for second key press

There are several options too.


as long as the timer is running, you are waiting ... otherwise not. This could be sensed with a property change sensor 
remember the wait state (either use build in state system or use a property to remember the state)


Do operation

This is up to you

Timer exceeds

either the delay sensor pops up or you measure this with a property sensor (greater than mode).

Example

I choose a delay sensor and the build-in state machine.

State "idle" (waiting for first key press)



State "waiting" (waiting for second key press)



Be aware when you have other "breaking" events beside timeout you need to add them too (e.g. pressing another key might break the combo).

Remarks

Yes, you can implement the same architecture with Python. There are no additional benefits.