UCCNC is unitless, so it will not do anything if it sees a G20 or G21. If you want to run both metric and imperial code, you need to setup separate profiles and use the appropriate one.