Not its name. Its class through alt names, I think yes, but not its actual name. FS2 uses the name of the ship as its identifier at a basic sexp and code level, so changing it would screw up the way FS interprets it within the mission.
That said, what's the precise situation you want to change it in? In a very small number of cases, you can sort of change the name of the ship, using a hack. Basically, you time a new ship, with a new name, to arrive at the exact time the other ship disappears (both with the "No Warp Effect" checkbox checked for arrival and departue respectively). You can use a variable to define the hull strength, and any other variables you think are important (eg. turret strength, subsystem strength etc.), and then use set-subsystem-strength, variable-name to define them at their old strengths as soon as the ship comes back. As with any hack, however, there are some caveats.
- You'll need to use get-position-x,y and z to determine the exact location of the ship and then apply them to the other ship the instant it warps in with set-object-position. Link this to the same set of circumstances that triggers the name change and you should be fine (i.e. no discernable flicker on the name change) (I think).
- You'll need to know the exact orientation and speed of the ship at the time of is name change, especially orientation. Speed, I'mnnot sure what the effect would be - it probably wouldn't be seamless if they weren't the exact same speed, but it'd be close. Now, at present, there's no way to get and apply the orientation of one ship to another ship, and it can;t be neatly stored within a variable since FS uses a series of 9 variables to define orientation e.g.
$Orientation:
-0.862001, 0.000000, -0.506907,
0.000000, 1.000000, 0.000000,
0.506907, 0.000000, -0.862001
Look in a mission file and you'll see stuff like that for every ship. The best (and only) way I can see to get around the problems of speed and orientation of the two ships is to use waypoints - as long as a ship is following a waypoint, you can cap its speed (using, shockingly, cap-waypoint-speed) and you know its orientation (towards the waypoint, so just like using set-object-position you can use set-object-facing-object (the objects being the new ship and the waypoint respectively). You can set the initial speed of the new object to be the capped speed of the old object in the initial status editor.
- If the ship is in the escort list, it'd be a good idea to define its position absolutely, by having all other ships either well above or below it, andf then giving the new ship the exact same escort priority. That way the new ship should replace the old one in the list in its exact same position
Do it right, and you should get a near seamless transition from one ship to the next. That's the only way I can think of that'll allow you to change the name in-mission.
NB - if your ship is unmoving, of course, the whole thing becomes easier by an order of magnitude. All you need to worry about then is hull/subsystem strength.