[vbscript mode] Total rewrite

Issue #1684