@baird1fa that is correct, the inches/mm setting is saved on entry to any macro and restored when it exits, along with some other parameters e.g. the feed rate and whether distances are absolute or relative. So you can safely use G20 or G21 at the start of your macro to ensure that movement commands in the macro are always interpreted the same way.
If you do need to detect whether inches or mm are being used, this is set separately for every input (so a job that changes the units to inches won't affect the behaviour of the jog commands in DWC or PanelDue). The current setting can be found in the object model as inputs[N].distanceUnit. The value of N for the input making the query is state.thisInput. So you would normally request inputs[state.thisInput].distanceUnit.