After the narrator has listened to the signalman's story, he feels really bad for the man. He understands how horrible the man's dilemma is and how the man really can't do anything to resolve it. So he decides to help. What he decides to do is to take the signalman to a really good doctor and see what the doctor says.
In order to do this, the narrator has arranged to come back and meet the signalman the next morning when the signalman will be off duty. He does not tell the signalman what he intends to do. Here's a quote to show this:
I ultimately resolved to offer to accompany him (otherwise keeping his secret for the present) to the wisest medical practitioner we could hear of in those parts, and to take his opinion.
Of course, this doesn't work because the signalman is dead by the next morning.