In this passage, the 1852 LDS edition changed the singular was to were even though the result was not grammatically correct (“every soul” is grammatically singular); in addition, within was changed to in in the 1852 edition, probably by accident. These two changes were followed in subsequent LDS editions until the turn of the century. The 1906 edition made two changes: first, who were (originally which was) was deleted; and second, within was restored to the text. These two changes were followed when numerous changes were made to the 1905 LDS missionary edition in its third printing (in 1907). And one more grammatical change was made in that third printing (but not in the earlier 1906 edition): namely, at the end of the passage, were slain was changed to was slain so as to agree with the grammatically singular “every soul” near the beginning of the passage. All LDS editions since 1906 have followed these changes. The original text permits both singular and plural verb forms with noun phrases headed by every, as discussed under Alma 11:41 for “every man”. Here in Alma 14:28, the original plural were slain was probably influenced by the immediately preceding use of were in “save it were Alma and Amulek”.
Obviously, the restored within is the correct reading and should be maintained. On the other hand, the 1906 deletion of who were (originally which was) was unnecessary. Nor is the original construction difficult to understand. The critical text will restore the earliest text in this passage despite the ungrammaticality of the last were (“and every soul ... were slain”).
Summary: Restore the original text in Alma 14:28, including the plural were at the end of the sentence: “every soul which was within the walls thereof save it were Alma and Amulek were slain”.