Runner encounters ICE, spends click to defeat first subroutine, and WHAM, Heinlien comes out and siphons the runners money away, leaving them with nothing to deal with the rest of the subroutines on that ICE.

OR

Runner encounters ICE, spends click to defeat subroutine, spends a credit or two to defeat ICE, moves past it, THEN Heinlien is triggered.

Runner encounters ICE, spends click to defeat first subroutine, and WHAM, Heinlien comes out and siphons the runners money away, leaving them with nothing to deal with the rest of the subroutines on that ICE.

OR

Runner encounters ICE, spends click to defeat subroutine, spends a credit or two to defeat ICE, moves past it, THEN Heinlien is triggered.

Well, Heinlien triggers as soon as its conditions are met. So if the runner spends a click to break a subroutine, he immediately loses all his credits. But he's free to break subroutines in other ways if able, before spending clicks. Remember that Heinlien Grid must be rezzed before the runner spends or loses a click in order to work. So you can't surprise a runner by waiting for him to spend a click, then rezzing Heinlien Grid and saying "Gotcha."

Runner encounters ICE, spends click to defeat first subroutine, and WHAM, Heinlien comes out and siphons the runners money away, leaving them with nothing to deal with the rest of the subroutines on that ICE.

As Novacat says, this is correct as long as Heinlein grid was rezzed before the encounter.