I have a source file with two similar yet subtly different sections. I\'d like to merge the two sections into one subroutine with a parameter that handles the subtle difference
Emacs has ediff-regions-wordwise for this -- you can take two buffers (or just one) and select a region in each, which ediff will then show for comparison.