If your script simply waits for a button to be pressed then does work and you are using Raspbian Jessie or Arch you should be able to accomplish this simply enough with Systemd units. If you follow the answer given in this SE post, correcting the various paths and users with the ones you are using, you might get what you are after.
Put the unit in
/etc/systemd/system and start with
sudo systemctl start what_you_called_the_unit and give it a test. It can be enabled on start up via
sudo systemctl enable what_you_called_the_unit
However if you need the script to interact directly with the user in anyway, such as offering an on-screen menu from them to select from or accepting a command from the keyboard, this approach won't work.
The OS (Linux) will always be running, its what makes the Pi 'do stuff', I'm guessing you mean the desktop UI? If so, it won't hurt to leave it running, you could remove it (not sure what you are running to give any info) or use something like Raspbian Lite which is just a command line shell if you don't need or want it. Maybe get this working before moving on to this though.
I've butchered a GPIO sample to provide a simple example of what I mean.
Python Code put in
/opt/myscript.py make executable
sudo chmod +x /opt/myscript.py:
rubbish program that would monitor Button presses, and on the third
press would end will print horses when the button is pressed
sample taken, butchered, from
import RPi.GPIO as GPIO
prev_input = 0
presses = 0
input = GPIO.input(17)
if (not prev_input) and input:
presses += 1
prev_input = input
if presses > 2:
Systemd Unit, put in
Description=My horse printing script
Then start the script via
sudo systemctl start myservice if you follow the logs via
sudo journalctl -u myservice you should see it write some 'starting' stuff then the word 'horses' for the first 3 times you press the button then it exits. This relies on you have a button connected to GPIO pin 17.