Hi Yash,
The TB6560 boards do have their own problems and many people have failed to use them successfully so you may be off to a shaky start to begin with.
As I have recently discovered it is difficult to accurately control Mach3 from an external processor, however, Mach3 does have the functions 'single block' mode (which will run one line of Gcode at a time) and the 'program safety lockout' (which will halt motion, usually at the end of the current line of Gcode). Both of these functions will operate from an external source but you may need to synchronize system clocks.
Information on this is, to a certain extent, contained in the Mach3 documentation so it looks like you may have a bit of reading to do.
Good fortune with your project.
Tweakie.