Custom database alert - Can it be done?
One easy way to do this is to create a SQL Agent job with a step that runs the following code:

&lt;Your SELECT statement&gt;
IF (@@ROWCOUNT &gt; 0)
    BEGIN
        RAISERROR('Long-running query detected!', 11, 1 )
    END


Configure notification on the job to send an email on failure, and if any rows are returned by the query, you'll get an email that the job failed.

Instead of setting up the job failure notification, you could set up a SQL Agent alert on the error that is raised as in the article you referenced.  But if the job notification is adequate it's less work to set up.