You could use the browser's close action? Although I don't see why this would be necessary on a mobile platform (and I'm unsure it would work). As for making the resume button visible:
On start of layout if (global variable) = 0, add 1
if (global variable) =1, set resume button visible.
You'll need to tie that variable in to a local storage setup so that it sets itself each time you load the game.
Hope that helps!