(1) good catch, yes it should be phi = apply(Fj,phi). I edited my comment above to reflect this.
(2) for spinful systems there can a subtlety depending on how the Jordan-Wigner mapping is defined. You can still just apply "F" on all of the sites to the left of site i. But then on site i the operator you need to apply can require on extra piece of string in certain cases i.e. when the Jordan-Wigner transformation maps completely to a bosonic operator obeying bosonic commutation relations.
*However* the operators "Cdagup", "Cdagdn", "Cup", and "Cdn" in the "Electron" site type in ITensor already include these extra, local minus signs that correspond to the "piece of string" I mentioned. So really the code above should 'just work' for spinful electrons too, as long as you just write "Cdagup" or "Cdagdn" for the operator whose matrix element you want and leave the rest of the code the same.