What you are doing is "self-limiting" which is not very effective. The devil on your shoulder will always fight this - "don't tell me what to do!"
The wanting to not doom-scroll should be intrinsic. I know that right now, for obvious reasons, it's easier said than done.
For me, it is, but I would still automatically open Reddit or Twitter when compiling code, and then get stuck in a loop of looking at interesting and/or annoying stuff.
The solution was easy, though, I just put all of these sites, Facebook, Reddit, Twitter, Instagram, etc. into my hosts file and pointed them to localhost. It took about a week for this automatic behavior to stop. Instead, I have a language learning app, so now I go through some flashcards while my code compiles.
Or open news.ycombinator.com. Maybe the next addition to my hosts file.