Your code looks fine, change the #1000's to #100's.
#1016 and #1116 are Inputs and Outputs inside Mach4.
Since Mach4 emulates a Fanuc 21i, the Fanuc Macro B Programming capabilities in Mach4 are incredible. I made an entire OD Grinding program based off of screen inputs and read those as #VARS inside my code.
I'm using the #1000 and #1100 variables for the inputs and outputs to look for flags in our auto measuring gauges.
On a DN Solutions DNM5700 we got in 2022 I'm using the same logic to look for inputs from our robot cell so we didn't have to spend thousands of dollars on extra IO Boards for the machine.