You did the right thing. He was up to no good.
Years ago i was staying with friends. They went to bed and I stayed up watching TV. It was about 2 am and the door bell rang. It wasn't my house, but i was curious so I looked out the peep hole and saw a young white male, shirtless. He rang the doorbell again. He then walked around to the back of the house. I went upstairs and oberved from a window. He knocked
on the back door. Then I saw that he went to the sliding doors at the rear of the house. By this time I knew I should wake my friends up. We ran downstairs and when we
got to the back of the house the guy had removed the screen and was trying to pry open the slider. My bud and I chased the guy down the street while his wife called the cops. When
we started chasing him a pick up truck parked on the street fired up and this guy jumped in the bed. The truck hauled it out of there.
I figured the guy rang the doorbell and knocked hard to see if anyone was home. When no one answered he must have thought the place was empty.
So, maybe your "guy" was trying the same thing.