From this post, Android disable screen timeout while app is running, I can disable screen timeout by
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSC
Do you just want the screen to time out after you've closed your application? Or is something inside your application going to reset the screen timeout so that it will happen even while your app is running?
If the former I don't think you need to do anything, when you're app is stopped the screen timeout will return to normal.
If the latter it seems like the snippet you've provided would do the trick. But I have no experience with it so I couldn't be certain.