• define a XSD
• define a XSLT to generate HTML or something similar
• write your procedure in XML files and keep it under source control
• transform the XML using the XSLT into HTML
The schema should allow to define tasks and dependencies and the transformation can then perform a topological sort and bring the tasks into the correct order. And you probably want a good XML editor with schema checking and autocompletion. An alternative to HTML would be LaTeX. You could also further process the output to generate a PDF.