Ok, this took a while to track down all the problems, but there are a couple issues I ran into before making this work. Two things you need to do: (1) Use the RC file
here, which is your
0.17 RC on CSZO modified to have the contents of autofight.lua at the end with the necessary changes to delta_to_vi(). Then (2) override your TAB key with a macro to have a target of ===hit_closest and then override Shift+TAB to have a target of ===hit_closest_nomove if you'd like that as well. If you don't make a macro for TAB, it tries to call the mapping for CTRL-I, which you have mapped to memorize spell. You can use CTRL-D or ~ to set a macro.
Some additional details I found:
It seems you do need the full contents of autofight instead of just the delta_to_vi function. Furthermore it seems that for lua coming in from an rc file, clua doesn't like it on line five of the original delta_to_vi() how the array is terminated with a brace on its own line. You may not have gotten this error, but I'm getting it on my Linux system. The original delta_to_vi() function is left below the modified one but commented out, for comparison.
Finaly, in the modified RC I posted, I removed a couple bindkey statements for commands that no longer exist: CMD_SEARCH, CMD_LIST_WEAPONS, and CMD_LIST_EQUIPMENT.