You could but you would not reach your ultimate goal. App Inventor apps cannot run as a Service (in the background) using native Blocks. When your app goes to sleep or your device is turned off, your code will not execute at 00:00. Your then statement will ONLY execute at exactly 00:00 if your app is awake and the device turned on. If the app is asleep or not turned on at midnight, the algorithm will have to wait 24 hours to try again and probably fail.
What you could do is compare dates. Save a date in a TinyDB, then compare it with the present date and figure out whether it is the next day. Certainly this is not changing at midnight but will execute the next day. see Clock .