Google for "debounce", in the examples you'll find you'll see how the millis() function is used to time events. Once you have the button debounced, just store the time of the last push. If the last push is within the double-click time you have an additional push (so increase the push-counter), otherwise you can activate the action you stored for the current value of the push-counter and reset it.