Yeah, hopefully it is just enough to add another check to fix this. Something like if (minutes > 0 or free throw attempts > 0), then the player played.
If I understood it correctly, the substitute must remain in the game until the next dead ball so he is forced to have playing time. This is from NBA rules.
http://www.nba.com/analysis/rules_9.htmlIf the offended player is injured or is ejected from the game and cannot attempt the awarded free throw(s), the opposing coach shall select, from his opponent's bench, the player who will replace the injured player. That player will attempt the free throw(s) and the injured player will not be permitted to re-enter the game. The substitute must remain in the game until the next dead ball.