The Question and Answer section for Rudyard Kipling: Poems is a great resource to ask questions, find answers, and discuss the novel.
The structure of the poem is dependant on introducing various principles of life that need to be discussed before a promise is given. The word "if" facilitates this process.
In context, Kipling is saying that a man's position in society has nothing to do with his character..... the virtues he exhibits. The poet is advocating humility, stoicism, and fortitude above all else.
In context, a man must stay true to his beliefs and trust himself because to allow others to affect or change his values sacrifices the identity of the man himself.