Arduino Motor Shield Stepper Motor control with Joystick

from what i can say it that the motor when it is not moving it draw a lot of current to make it stand still, i can say that the motor need to been a low current mode when not moving. there a few way you could do this, did you know that at port A0 and A1 of the motor shield there is a current monitoring circuit. actually it is build in into 298 ic. that is you need to read the voltage value using analogread on port A0 and A1. this part i dont really know how since the page
http://arduino.cc/en/Main/ArduinoMotorShieldR3 talk very little about this feature. what is only said that 3.3V is calibrated to be equalvelent to 2Amp. what i do not know is, is the 3.3V mean 1023 in analog read or if it is just a value in the middle so that you could stop the motor b4 the current get to high? anyway in the program i gave you b4 there is one missing link

 if (PVal >= 507 || PVal <= 517)
  { // fill in with the one you need to make it brake
  }

since i dont have the shield i cant test how to make it stop safely. i hope you could fill in the program
however my fair guess is that you need to turn the pwm LOW for both. This should reduce the amount of current running thru the coil thus making it cooler.

if (PVal >= 507 || PVal <= 517)
{digitalWrite(pwm_cha, LOW);
    digitalWrite(pwm_chb, LOW);}

however you must update the other part of the program with

digitalWrite(pwm_cha, HIGH);
    digitalWrite(pwm_chb, HIGH);

at every other if statement immediately after the {

for the heat sink just use any regular metal block. if you could find one that is small enough for the biggest IC on board that is 298 with fin, that would be great, plus if you have some thermal paste between the heat sink and the ic would be great. there is no mounting hole that you could use hold the heat sink. so although most of the time i would not recommend this but use some glue to make it hold. not much just a small dot at the edge so that it is enough to hold the heat sink is suffice.