Based on the thought that the Finder doesn’t recognise itself as a process my first idea is:
set bingo to ((processes whose frontmost is true) = {}) and selection = {}
I strongly advise witholding any thought of obsequities until well after some testing!
Just realised that you will, of course, also need “and windows - {}”.
By “windows showing”, do you mean “container windows”, “container windows but excluding pop-up windows”, “any windows at all”, or “any windows at all except pop-up windows”?
Andreas’ suggestion is pretty good. Here’s an alternative, tested in Mac OS 8.6 and Mac OS 9.2.1:
tell application "Finder"
it is frontmost and ¬
(container windows whose popup is false) is not {} and ¬
front content space is desktop's content space
end tell
NG