You can set up a custom counter for this.
The steps are:
Create a SQL custom counter using slightly modified SQL that returns a count
select count(1)
from master..sysprocesses p
CROSS APPLY sys.dm_exec_sql_text(p.sql_handle) t
where open_tran = 1
and last_batch < dateadd(hour, -1, getdate())
and t.text like '%WriteLockSession%'
Save that custom counter.
Edit alarms.
Choose the SQL Custom Counter alarm.
Check the override checkbox.
Click Add next to the Severity list.
Select the name of the custom counter from the dropdown.
Click Add Severity.
Add a severity with a start value of 1 and an appropriate message. Put {{value}} into the message if you want to see the custom counter value in the message.
Press OK.
Now an alarm will be raised when the SQL detects a long running session. An alarm action can be added to send an email or some other form of notification if this alarm is raised. Also an action that executes SQL can be added to automatically kill the sessions if that is desired.
Custom counters execute every 5 minutes by default but that can be changed via the schedule editor.