For Case2 it means learning how SimpleTimer works.
There was a good example posted a few weeks ago using the timeout feature.
Study this thread in detail for inspiration and work through the code [SOLVED] Virtual button pressed for X seconds
PushData sketch, available from Sketch Builder link at the top right of this page, is also a very basic example of how SimpleTimer works.