The debug port that the questioner refers to is for source code debugging, such as with an Eclipse debugger. The port for VisualVM is the JMX port, which takes a different set of JVM options. There are exceptions though: Mission Control for JRockit uses the jdwp port rather than the JMX port.
And yes, you can dynamically load the JMX debugger in code. Its complicated but OSGI can load this dynamically I believe. For example, here is a reference to Jetty project doing this.