The main observations are (very easy trig and algebra):
1) to get one pulse, run for either 180 or 360 degrees, instead of all the time.
2) depending starting angle, you could go down/up, up/down, snap up then go down, ... so pick the starting angle correctly, using a sin/cos chart.
3) cos/sin thinks 0 degrees is aimed to the right, and goes counter-clockwise in radians. There are 2*PI radians (6.28) in a circle. If you try to use 0-360, you get crazy fast spins. Other things in Unity use degrees and 0 is up, but cos/sin uses "real" math.
4) Sin/Cos go between -1 and 1. `Mathf.Cos( phi ) * 0.5 + 0.5;` (from your code snippet,) scales/slides the range to go from 0 to 1. If you used *2+3, it would go from 1 to 5. The + is the center and the * is the amount +/- it moves.
This C# code worked for me:
// globals:
float growEndSecs = 0;
float GROW_TOTAL_SECS = 2.0f;
// sample line to test:
if(Input.GetKeyDown("z"))
growEndSecs = Time.time + GROW_TOTAL_SECS; // do this to start growing
// are we currently growing?
if(Time.time < growEndSecs) {
// pct goes from 0 to 1:
float pct = 1 - (growEndSecs - Time.time)/GROW_TOTAL_SECS;
// scale to start ang at -90 (-PI/2), so sin starts at lowest value and goes up:
float ang = pct * 2*Mathf.PI - Mathf.PI/2.0f;
// Sin(ang) goes from -1 to 1 back down to -1. Scale to go from 1 to 2 to 1:
float scaleFact = Mathf.Sin(ang) * 0.5f + 1.5f;
// NOTE: this ranges from 1.5 +/- 0.5, so 1 to 2
// to get 1 to 3, for example, use *1+2
transform.localScale = Vector3.one * scaleFact;
}