Your best option is to start with an Active Choice Reference Parameter of type 'Formatted HTML' or 'Hidden Formatted HTML'
Make sure that your groovy script returns a string of the type shown in the referenced blog entry i.e.
return "<input name=\"value\" value=\"${dynRefParam}\" class=\"setting-input\" type=\"text\">"
See also Scenario 3 example from Active Choices wiki page.
Perhaps you can post your setup and we can provide more detailed help
Hope this is enough to get you started!
Ioannis