Apparently that wasn't as easy as I thought since it didn't detect whether the king would pass through check from new pieces, which I also don't know how to fix.
EDIT
I think I found a solution by modifying the fairychess castling subroutine to move the king and rook one space over after castling. It highlights the h2 and h9 squares for moving to instead of i2 and i9 but it works.
Apparently that wasn't as easy as I thought since it didn't detect whether the king would pass through check from new pieces, which I also don't know how to fix.
EDIT
I think I found a solution by modifying the fairychess castling subroutine to move the king and rook one space over after castling. It highlights the h2 and h9 squares for moving to instead of i2 and i9 but it works.