I think the short answer to your question is no. According to this help topic on the InnoSetup website about a similar matter:
http://news.jrsoftware.org/news/innosetup.code/msg25634.html
It says in part:
RemObjects Pascal doesn't support custom ([Code] created) classes.
So I don't think you can do what you are desiring. The above discussion thread mentions a possible workaround:
You can define a "record" containing all of the desired fields, and an
"array of" your record type to create a dynamically-expandable indexed
list of them.
You can't define methods or constructors/destructors directly attached
to these, but you can define loose procedures/functions that do the
equivalent.
That's as close to custom classes as you're going to get in ROPS.
I do not know if that will be sufficient for your needs.
If you need to research InnoSetup code functionality there is a great resource here:
http://www.jrsoftware.org/newsgroups.php#search