No reason why not except it might make life difficult if ever you need to take it apart again.
Every 3 speed box I've had apart has had the long key sheared in two. It doesn't seem to matter because it's never been the reason I've stripped the box.
If the lay shaft is worn ie the gears are a loose fit on the shaft then probably you should tend to that, but I've put sheared keys back before now if they were otherwise un damaged.