Walking (as a show of belief) between the hills of Safa & Marwa (near Mecca) is a God sanctioned ritual (instituted by Abraham) and a part of the pilgrimage to Mecca. This ritual is not a sin (in spite of the fact that it was practiced unknowing of its origin by the pagans in the past); after all, God knows what is in your heart (that this act of yours is to please God and not to glorify the idols of the past.)