um - you're example looks fine, except you're not loading the INI value when the WebServer starts.
ie in WebServer;
INIMgr.Fetch('WebServer','WBPorta',dg:WBPorta)
One minor issue is if the user cancels the form, then for a period the global variable has been cleared. I have tweaked the 6.24 code to avoid this problem.
(aside: changing the port number of the server itself is slightly complex because the server would need to be stopped and restarted, and of course the user would then effectivly need to enter a new url to continue. But that's a very special case and outside the scope of this question I think.)
Cheers
Bruce