Correct, it's treated as a run play. That's why I threw in the part about IFP. I.e, QB throws pass 2 yards beyond LOS, he gets the yardage gained on the run but is penalized from the spot, essentially the EOR.
Behind the line, foul will be assessed from there.
I didn't really mean for you to actually remember the rule cite, figure of speech.