what your code actually says is: after 30 seconds of total usage of the application that you selected (applications.applicationTokens) the "eventDidReachThreshold" of the DeviceActivityMonitor extension will be called. handle your event ".encouraged" inside the "eventDidReachThreshold" and do there what ever you like.
i think for you case if you want to limit some apps for a period of time just make a scheduled event that start from the current time you tapped an OK button (or some other action) to current time + limitation time of tour choice. and on your DeviceActivityMonitor extension you should handle the blocking and unblocking on the intervalDidStart and intervalDidEnd
the your code should look something like this:
do {
let schedule = DeviceActivitySchedule(intervalStart: start, intervalEnd: end, repeats: false, warningTime: nil)
try center.startMonitoring(.block, during: schedule)
} catch {
print("error: " + error.localizedDescription)
}