Review the original item:
Gustavo can tolerate any lecture, no matter how boring the instructor
is,
in his mind, Gustavo imagines that he is on board the starship
Enterprise, blasting Romulans from his post on the bridge.
You wanted to fix it this way:
Gustavo can tolerate any lecture, no matter how boring the instructor
is in his mind, Gustavo imagines that he is
on board the starship Enterprise, blasting Romulans from his post
on the bridge.
To delete the comma between is and in would cause an equally bad problem, a fused sentence. A fused sentence occurs when you have two complete sentences joined with no punctuation whatsoever. Gustavo can tolerate any lecture ... begins the first sentence. In his mind, Gustavo imagines ... starts the second sentence.
The spot between is and in needs a stronger break than blank space.
You might want to consult the rules for fixing comma splices and fused sentences.