MonoBehaviour.Invoke not working as expected

I have a gameObject, the tag of which I want to get changed when a static variable in another objects script changes to a certain value. After 5 the tag must change again. So I attached the following script to my gameObject:

function Awake () {
        gameObject.tag = "HeatOff";   //this is the initial tag

function Update () {
        if (otherObject.someBooleanTrue) //...when that other boolean changes to true...    
        gameObject.tag = "HeatOn";  //...I want my gameObjects tag to change to this
        Invoke("ChangeTagBackToOff", 5); //... after 5 I want to invoke the following method

    function ChangeTagBackToOff () {
    gameObject.tag = "HeatOff";  //...which reverts my tag back to it's initial value

What I get is the following error:

...BCE0044: expecting (, found ChangeTagBackToOff.

What am I doing wrong? I feel sure that the used syntax is correct.

You put the function to invoke inside of update. Move it outside of it and it should work fine.