The old man was not related to Madeline O'Malley. She died in the 1800s, and he is not old enough to be related to her. The Yankee Pedlar Hotel (a real hotel) is renowned for its hauntings:
...rumors of wanderings by the ghosts of original owners of the hotel,
Frank and Alice Conley, random disembodied voices, a chair that rocks
on its own and doors that close on their own.
Room 353, which many believe to be the heart of the hotel's hauntings
because Alice Conley died there, is depicted in the movie as the most
haunted room in the hotel. West said he chose that room for shooting
without knowing of its history or notoriety.
"We picked the room because it was at the end of a hallway," he said.
"When shooting, we learned it was the most haunted room in the hotel. (From an article in the Hartford Courant.)
This review in The Atlantic suggests a reason for the old man and the other random hotel visitors:
That absence of direction is what The Innkeepers is really about, and
where its real horror lies. West's film is a visual manifestation of
the trapped psychology and the deeply unsettling anxieties of the
aimless. He accomplishes this with cleverly placed peripheral
characters that he describes as "representations of where you can go
in life." One of the hotel's rooms is occupied by a mother and her
young son; she's having marital trouble and needs to get away from
home for a few days. Another is a barista saddled with relationship
problems so tedious to hear about that Claire bolts the coffee shop
without even getting her drink when forced to listen to them. A sad
old man shows up after the death of his wife to spend one last night
in the room where they had their honeymoon decades ago. All roads lead
back to the Pedlar. Add in the ghost of a bride who committed suicide
in one of the rooms, and one can't even escape after death.