I'm not sure exactly what you are trying to do, but I'll take a stab at it and give some suggestions. As far as I know, you can't simply yell at the N7 and tell it to "Shut up!", regardless of its sleep or screen state. You'll have to have physical contact with it, which it enjoys.
1. The most obvious solution is to mute the N7 before you and it go to sleep. I say this because I assume your desire is to silence the N7 when its notification bells and whistles start chirping at you in the middle of the night.
2. Use an app like Power Toggles. This lets you place controls in the pull down notifications shade (as well as on the home screens as widgets). One of the controls it has is a mute button. To use it, you'll still need to press the power button to activate the screen, but you don't need to unlock it, saving you a step. Once the screen is on, pull down the notifications shade and tap on the mute icon.
This app is free and contains no ads:
https://forums.androidcentral.com/e...pps/details?id=com.painless.pc&token=yZKmtsY9
3. Use an app like Tasker. This lets you control how your device behaves, depending on the time/date, location, or status based parameters you've set up. I've not tried this scenario, but it could probably be programmed to automatically mute your N7 when the screen goes off, and unmute it when you activate the screen. You could even base the mute/unmute action on your GPS location or time of day. This app has a bit of a learning curve, but it might be your best solution.
This is a paid app but a trial version is available from the dev's web site:
https://forums.androidcentral.com/e...=net.dinglisch.android.taskerm&token=rEmJI7ky
4. Use an app like Battery Widget Reborn. This has a "night mode" power saving feature that can be easily programmed to start and then stop at specific times of the night/day (it can also be manually activated). Power saving mode includes WiFi, Bluetooth, background sync, display notifications, and sound (muting). You can select any combination or all of those items to be turned off while in night mode. Keep in mind that this has nothing to do with whether or not the screen is on; it's based solely on the time of day, similar to an alarm clock, with a single on/off setting per day.
This is a paid app, but a trial version is available:
https://forums.androidcentral.com/e...ubalek.android.apps.reborn.pro&token=EFLoXiB5