Ghost levitating

Hello, I want to make my ghost levitating up and down and patroling side to side but when i tried some methods to make my ghost levitate, it just levitated, it didnt patrol so i want to ask if some one know how to make the ghost levitate and patrol at the same time.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyMovement : MonoBehaviour
{
    public Transform[] patrolPoints;
    public float moveSpeed;
    public int patrolDestination;

    public Transform playerTransform;
    public bool isChasing;
    public float chaseDistance;



    // Update is called once per frame
    void Update()
    {
        

        if (isChasing)
        {
            if(transform.position.x > playerTransform.position.x)
            {
                transform.localScale = new Vector3((float)-0.145491, (float)0.145491, (float)0.145491);
                transform.position += Vector3.left * moveSpeed * Time.deltaTime;
            }
            if (transform.position.x < playerTransform.position.x)
            {
                transform.localScale = new Vector3((float)-0.145491, (float)0.145491, (float)0.145491);
                transform.position += Vector3.right * moveSpeed * Time.deltaTime;
            }
        }

        else
        {
            if(Vector2.Distance(transform.position, playerTransform.position) < chaseDistance) 
            {
                isChasing = true;
            }

            if(patrolDestination == 0)
            {
                transform.position = Vector2.MoveTowards(transform.position, patrolPoints[0].position, moveSpeed * Time.deltaTime);
                if(Vector2.Distance(transform.position, patrolPoints[0].position) < .2f)
                {
                    transform.localScale = new Vector3((float)0.145491, (float)0.145491, (float)0.145491);
                    patrolDestination = 1;
                }
            }

        }



        if (patrolDestination == 1)
        {
            transform.position = Vector2.MoveTowards(transform.position, patrolPoints[1].position, moveSpeed * Time.deltaTime);
            if (Vector2.Distance(transform.position, patrolPoints[1].position) < .2f)
            {
                transform.localScale = new Vector3((float)-0.145491, (float)0.145491, (float)0.145491);
                patrolDestination = 0;
            }
        }
    }
}

You can look at levitating as an “offset” that you add to normal patrolling.
In other words , just do normal patroling , then add your “levitating” offset to it before assigning as the final position , you can separate the levitation to a seperate method like this

private Vector3 LevitationOffset()
{
      float levitationHeight  = 1;
      float levitationSpeed = 1
      float levitationOffset = Mathf.Sin( Time.time * levitationSpeed ) * levitationHeight ;
      return new Vector3(0 , levitationOffset , 0);
}

Then do your normal patrolling , and add it at the end

// todo : code to do patrolling
Vector3 PatrollingPos = **to fill in**;
Vector3 posWithLevitation = PatrollingPos + LevitationOffset();
transform.position = posWithLevitation;