Aren't mindmaps used for brainstorming? Why would one programmatically create one? Unless one was attempting to help an AI to become self-aware...
I scratched the surface with mindmaps on the suggestion of a behavioral health associate a short time ago. I stumbled upon
Freeplane and it appears to support
scripting via Groovy and other languages. Would that get you what you want?
Since I haven't used mindmaps much, I can't really compare Freemind vs. Freeplane.
ETA: Freeplane is a fork of Freemind.