Can Samsung Multipurpose sensor detect knock ONLY when closed?

The standard SmartThings features don’t have a “while” condition, but the community developed smartapp core does. I expect it would be pretty easy to do with that.

Here’s the peer assistance thread for core, just ask there.