Here's my (pretty much scripted) response to these kinds of approaches:
"Hey, sorry to hear about your trouble. You know, the county has a program to help you out with that, let me call a deputy (police officer) who will be glad to help you."
My home county actually does have a procedure for referring legitimate needs to appropriate help agencies and I have discussed the issue with my county sheriff's office. They agree that this is a valid approach. They also agree that somewhere in the neighborhood of 99% will immediately depart the area.
I think most other locations have such help available for the really needy.
Of course, the approach should be significantly and more firmly different depending on the aggressiveness of the approach.
I often carry a few cards from the referenced agencies, but don't get the chance to hand them out much
.
YMMV, of course and I agree that the OP did quite well, indeed.
Best,
Will