1) Why write your own script? Just use sp_whoisactive!! AMAZING FREE script from Adam Machanic.
2) You typically need to use 2 connections to create blocking.
spid1:
BEGIN TRAN
SELECT *
FROM myTable WITH (TABLOCKX)
WHERE something
spid2:
BEGIN TRAN
SELECT *
FROM myTable WITH (TABLOCKX)
WHERE samething
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service