Your application is not hard to do. I have a book by Scott Edwards called "Programming and Customizing the Basic Stamp Computer" were he covers a application with X10 using the Basic Stamp 2. They are schematics and code for you. You also can look on the Parallax site for Nuts & Volts articles that covers X10.
I was looking at my book that, I suggested you to look at and also looked at the Basic Stamp Editor help file and noticed that, you can also use X10 power-line interface PL-513 or TW-523 which is compatible with the Basic Stamp 2.
Here is an example of the XOUT instruction that you can use as test code:
Zpin PIN 0 ' Zpin is P0
Mpin PIN 1 ' Mpin is P1
HouseA CON 0 ' House code A = 0
Unit1 CON 0 ' Unit code 1 = 0
Main:
XOUT Mpin, Zpin, [HouseA\Unit1] ' Get unit 1's attention..
XOUT Mpin, Zpin, [HouseA\UnitOn] ' ..and tell it to turn on
END
Comments
Here is an example of the XOUT instruction that you can use as test code: