Need Help in Lua Script for Lighting LED in Specified Path

Hello everyone, I am fairly new to the world of copters and more so the domain of LUA scripting. I am not entirely sure I might even need lua scripting. The objective that I want to acheive is as follows:

I want to fly the pixhawk 2.4.8 powered copter to a certain altitude. Treating the current position as one of the four vertices of square, I want to give coordinates relative to the starting point. At each point I want to light the LED to a certain colour for a certain duration and then move on to the next point. After covering all the four points, I want it to land.

I do not want to give waypoints in mission planner PLAN section as it records in terms of the latitude and longitude and also because I cannot create a perfect square (in terms of coordinates at least). I want all the coordinates to be relative and be given w.r.t home position. Is there a way I can achieve this through LUA scripting.

I do not want to use an onboard computer as I want to keep the drone as light as possible. Also I would want to eliminate any lag associated with sending MAVlink commands to the onboard computer etc.

As a start, I have identified few functions, I plan to use. I’ll attach it below:

  1. vehicle:start_takeoff() – for taking off to a certain altitude
  2. ahrs:get_location() – to identify its current position
  3. get_distance_NED() – To identify the distance between the current position and next

I currently do not know how I can trigger the LEDs. I would go through few examples in the AP_scripting examples. Few queries I have are:
What kind of output does ahrs:get_location() give? How do I give relative coordinates such as (0,0,5), (3,0,5), (3,3,5), (0,3,5).
The coordinates being- fly to altitute of 5m,
→ move 3m towards the right at the same altitude,
→ move 3m forward,
→ then 3m left
→ and then 3m backward, all at the same altitude in the (x,y,z) coordinate system.
If someone could also point me to a source for learning arducopter specific lua scripting, that would be helpful.