My word here is by no means final—there is no clear answer to your question that I can find—but I have a good argument for resolving your case based on the existing rules, FAQ, and card text.
There is no rule that states that Emergency Repairs cannot be played in an action cycle began by a player announcing a card that turns out to be a Direct Hit!.
(The following is worth mentioning: Sabotage—another action with ‘immediately’ in the Play text is explicitly said to not be announced, which would mean there is no cycle of actions played by other players, as that text only takes effect after an action is announced. It would seem ideal that other immediate Action Cards be given a similar non–announced status, but no one asked me.)
The use of ‘immediately’ in the Play text of Direct Hit! implies that it happens before any other actions could possibly be announced— except for others with the same same trigger in its Play block. The closest thing a player being attacked has to Direct Hit! is Recheck, which instead reacts ‘immediately’ to the die roll— before the damage has been inflicted.
I believe there is a reason for the lack of contradictory immediate actions that are triggered by the same state. The only exception is the pre–combat phase, and the FAQ has a solution for resolving those actions. (Rulebook effects are treated here as actions, as well— which demonstrates that immediate effects on Action Cards are treated with the same priority as immediate rulebook effects are.)
So… if we got to the situation where Emergency Repairs is played in an action cycle began with the announcing of an Action Card that turned out to be a Direct Hit!, it would still resolve.
Emergency Repairs does not target a ship or fleet, but rather the system that it resides in (the targeting text is simply “Choose a system”). Other ships (if any) in the system, for example, would still be repaired. You could technically play it on a system you have no ships on, as it does not require you to have any ships in said system. (It has not received an erratum which requires presence like Direct Hit! has.)
It would be possible to play Emergency Repairs in an action cycle started by a Direct Hit!, and then use Sabotage on the Direct Hit!, though…