Here the 1830 typesetter accidentally omitted the past perfect auxiliary had near the beginning of verse 5 (thus replacing had had with had ), but in the subsequent main clause he kept the had had. This second example of had had parallels the first one (note, for instance, the use of the yea); thus the first had had should be restored.
Summary: Restore the original first had had in Alma 31:5 (“the preaching of the word had had a greater tendency to lead the people to do that which was just”); this change restores the parallelism with the second had had in the verse (“yea it had had more powerful effect upon the minds of the people than the sword”).