How can I create a custom popup message when I open an app? I want to be able to have a popup message when I open an app, say Facebook, that reminds me that I'm wasting time.. 

That is:


Click on Facebook app.
Facebook opens.
A message pops up saying "You should be working" (or any custom message I would like).
I can accept and continue on Facebook.


I'm thinking there could be an app for this but I can't find what I'm looking for.
Use an automation app to accomplish it. Here is how to do it with MacroDroid:


In the Triggers tab, in the Applications section, select "Application Launched/Closed, choose Application Launched and enable Force legacy mechanism, click OK. Select an app on the list, then click OK.
In the Actions tab, in the Notifications section, select "Display Dialog". Enter a title and the message to display.
Give the macro a name and save it. It will look like the image below.


Whenever you launched the selected app, a message with the title and message you set will be displayed.