이렇게 is used when what the speaker is refering to is right there at the moment. See, in your first example, the speaker said '이렇게 신났어요?', so we know that the listener is excited when the speaker is speaking to the listener.
In your second example, '그렇게 열심히 공부해요?' the listener is currently not studying, but has been studying hard. If the listener was currently studying, the speaker would've said '이렇게 열심히 공부해요?' since the hard-studying action the speaker is trying to reffer to is right there.