The simple answer is that enemyRole, enemySpec, and enemyClass haven't been set yet when the function returns their values. The INSPECT_READY event is fired at some point in the future after that point.
Also, you also really don't want to be creating a new frame/event handler for every call.
|