Its a bad practice to redefine datastore['RHOST'] from source code. Datastore options are thought to be defined by user. I would say use use an instance variable, assign datastore['RHOST'] first, and redefine it if necessary.