you find out, which JOSM classes implement the JOSM tools, i.e. the functionality for "Parallel tool"
you find a way to use this classes from a script. In some cases this is straightforward. I other cases, it is more difficult, in particular, if the functionality you are interested in is baked into JOSMs user interface classes.
Is is possible to call same JSOM tools from scripting plugin? For example, "Parallel tool" to create parallel clone of the way.