You're making it a lot more complicated than it needs to be. You want RANDOMIZE TIMER() and SET TEXT OPAQUE to only be seen once so they need to be at the top.
With this program a simple WAIT KEY is only needed instead of a DO/LOOP with a check for the return key with an EXIT.
The SET CURSOR command is nice but it's better to use TEXT that combines SET CURSOR and PRINT in one command.
You don't really need a check for P=2 because P is the number of points you want (I assume) which can be added to the INC command. Otherwise you'll be making IF/THEN statements for each amount of points.
I put each KEYSTATE() check in a FOR/NEXT loop so you can see an easier way to check for multiple keys without having to repeat several lines.
REM "Coin Tossing"
REM **PROGRAM TOSSES A COIN AND COUNTS HOW MANY HEADS AND TAILS THERE HAVE BEEN
REM **START**
Randomize Timer()
Set Text Opaque
Gosub Setup
Gosub Menu
Main:
cls
Do
text 200,1,"HEADS "+str$(H)
text 400,1,"TAILS "+str$(T)
C=RND(1)
If C=0
text 5,50,"Heads"
Inc H,P
Paste Image 1,5,100
endif
If C=1
text 5,50,"Tails"
Inc T,P
Paste Image 2,5,100
endif
text 5,150,"Press any key to throw again"
` Wait for a keypress
wait key
Loop
Menu:
text 5,10,"Press the corresponding number to select a coin"
text 5,50,"1. 1p Coin"
text 5,100,"2. 2p Coin"
text 5,150,"3. 5p Coin"
text 5,200,"4. 10p Coin"
text 5,250,"5. 20p Coin"
text 5,300,"6. 50p Coin"
text 5,350,"7. £1 Coin"
text 5,400,"8. £2 Coin"
` Repeat this...
repeat
` Go through all the keys
for t=2 to 9
` Check if the key has been hit
if keystate(t)
` Set the points
P=t-1
exit
endif
next t
` ... Until P is more than zero
until P>0
return
Setup:
`Sets variables
H=0:T=0:P=0
`Loads images for coins
Load Image "Media\2pheads.jpg",1
Load Image "Media\2ptails.jpg",2
Return