Conditional program flow in legacy MobiControl script is extremely limited. 

 

The "IF" condiditional flow on javascript has been tested OK on latest MobiControl AE device agents.  However, there currently seems to have little/no  functions to support basic user interaction in MobiControl javascrpt engine implementation.  So, what you need in .pcg post-install operation seems to be not doable with either script language at the moment.