If you must run both imperial and metric code, it's recommended to set up separate profiles for the different units.
There are a lot of things that can go wrong, especially if there are commands that send the machine to machine coordinate locations. And there are probably a few bugs in there somewhere as well.