How to match two signals that have similar shape but are scaled and expanded?
You can always match the extrema via a simple linear mapping, e.g. $y[n] = \frac{x[n]-min(x[n])}{range(x[n])}$ where $range(\cdot)$ is the absolute difference between the maximum and minimum values and $x$ is the input signal. This will get $y \in [0 .. 1]$ and then you can shift that interval to whatever (min,max) and baseline you like.

The dilations in time might be a bit harder to deal with.

If you are positive that the dilations are more or less by a constant factor, then prior to assessing the similarity between the two waveforms you can resample the longer one down to the length of the shorter one and then apply correlation. In fact, you could still base your similarity only on the comparable portions of the signals spectra, either by a direct error term or via something like coherence.

But if the dilations are not stable, then Dynamic Time Warping (DTW) (as was suggested) is the better option to go for as it will give you a "speed up / slow down" vector which you can use to either map one signal on top of the other or directly, as a similarity / disimilarity metric.

Hope this helps.