cool story.
yeah, WD-40 is a pretty good way to remove old gunk from things like chains. I would definitely remove the chain completely from the bike before using it though. be sure to get the chain really clean and put a proper chain lube on it afterwards.