You could do this with user groups: New user group "Recently active users" and move the affected users to that group (and remove then when necessary). Then it would be easy to exclude them from viewing the ad(s).
BUT: you still need an add-on, that manages the user group memberships. I not aware of such an add-on. I would not recommend to do this on runtime (this would be to much calculation on most page requests), but via the cron system (e.g. once a day).