Originally it referred to a position a soldier adopted: http://images.jupiterimages.com/comm...8/23057830.jpg . It's still used that way in a military context 'Stand at attention when you're addressing a senior officer'.
To snap to attention meant to move to that position quickly. But now your guess is right - to become attentive, and to show that you are.
- For Teachers