"... that had stopped half an hour ago" VS " ... that had stopped half an hour before/earlier"

Solution 1:

I think you are in error. "Ago" means "counting back from now", but in a narrative, now is the time being described. So

He went back to the engine room. The engines that had stopped half an hour ago were in action again.

is just valid as

I go back to the engine room. The engines that stopped half an hour ago are in action again.

In both cases, "ago" is accurately describing the relative interval between the current narrative time and the previous time. "In the past" relative to the contextual time.

Solution 2:

How come you have the opinion that "ago" can't be used with past perfect tense?

See Collins dictionary ago. They have examples with past perfect + ago.

http://www.collinsdictionary.com/dictionary/english/ago

The example from Collins is not the best as it is indirect speech. Better examples from http://sentence.yourdictionary.com/ago

Only a few minutes ago she had flaunted death.

Long ago she had learned to ignore the second glances, open stares, and sometimes even suggestive leers of men.