Your solution suffers from a rather obvious defect: it doesn't handle views
Look at the title...Tables referenced by a stored proc!
It does what it says on the tin....and there's a warning on the tin regarding commented tables.
You've said it's not very hard to do better...I look forward to seeing it.
Best,
David.