Service only application
You could build such a service using any tool that results in an application bundle; this includes AppleScript/JavaScript (OSA), Objective-C, and Swift. Apple would likely prefer you used Swift.
Investigate the Accessibility APIs for interacting and manipulating windows owned by other applications.
See the Info.plist value LSUIElement for making an agent application:

LSUIElement (Boolean - macOS) specifies whether the app runs as an agent app. If this key is set to YES, Launch Services runs the app as an agent app. Agent apps do not appear in the Dock or in the Force Quit window. Although they typically run as background apps, they can come to the foreground to present a user interface if desired. A click on a window belonging to an agent app brings that app forward to handle events.
The Dock and loginwindow are two apps that run as agent apps.

To be distributed on Apple's Mac App Store, an application must have a user interface. This can be a simple window that enables your service, or handles preferences.
Search GitHub for status menu app for open source examples.